@figurosity/consumer-three-dimension-tool 0.5.0 → 0.8.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.
@@ -1,46 +1,46 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".tool-reset-button .qbtn{color:#333;font-weight:700}.debug-color{max-width:100px}.debug-color .swatch{height:20px;width:20px;border-radius:10px;border:1px solid #333}.debug-color .label{font-weight:700}.debug-value span{margin-top:2px;min-width:60px;font-size:11px}.debug-vector{min-width:130px}.debug-vector>div{font-size:10px}.debug-vector>div>span{min-width:20px;font-weight:700}.debug-boolean .indicator{margin-top:6px;margin-right:4px;height:10px;width:10px;border-radius:10px;border:1px solid #333;display:inline-block;background:red}.debug-boolean .indicator.on{background:#adff2f}.debug3D{position:absolute;z-index:14400;top:20px;left:40px;padding:20px;border:1px solid #ccc;border-radius:10px;background-color:#ffffffb3}.debug3D .color-square{display:inline-block;height:15px;width:15px;margin-bottom:-3px;border:1px dotted black}.three-dimension-tool{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100}.three-dimension-tool .tres{width:100%;height:100vh}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- import { watch as O, ref as pe, nextTick as ns, onUnmounted as _t, computed as C, onMounted as jt, openBlock as nt, createElementBlock as rs, createCommentVNode as vt, createElementVNode as is, onBeforeMount as as, defineComponent as R, h as d, inject as xt, useModel as ls, onBeforeUnmount as cs, createBlock as mt, unref as ft, withCtx as ht, createVNode as us, mergeModels as ds } from "vue";
3
- import { useQuasar as ps, QBtn as Ut, QSeparator as Ie, Platform as ms } from "quasar";
4
- import { CBaseButton as Ce, CColorPickerPopup as fs, CExpansion as We, CToggle as Ot, CSlider as Ke, CBaseButtons as $t, CDraggableDrawer as Pe, CDraggableDrawers as hs, CToolPage as gs } from "@figurosity/consumer-controls";
5
- import { defineStore as Xe, storeToRefs as $, getActivePinia as bs } from "pinia";
1
+ (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(".tool-reset-button .qbtn{color:#333;font-weight:700}:has(>.frozen-overlay){position:relative}.frozen-overlay{position:absolute;z-index:10;top:0;left:0;bottom:0;right:0}.debug-color{max-width:100px}.debug-color .swatch{height:20px;width:20px;border-radius:10px;border:1px solid #333}.debug-color .label{font-weight:700}.debug-value span{margin-top:2px;min-width:60px;font-size:11px}.debug-vector{min-width:130px}.debug-vector>div{font-size:10px}.debug-vector>div>span{min-width:20px;font-weight:700}.debug-boolean .indicator{margin-top:6px;margin-right:4px;height:10px;width:10px;border-radius:10px;border:1px solid #333;display:inline-block;background:red}.debug-boolean .indicator.on{background:#adff2f}.debug3D{position:absolute;z-index:14400;top:20px;left:40px;padding:20px;border:1px solid #ccc;border-radius:10px;background-color:#ffffffb3}.debug3D .color-square{display:inline-block;height:15px;width:15px;margin-bottom:-3px;border:1px dotted black}.three-dimension-tool{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100}.three-dimension-tool .tres{width:100%;height:100vh}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import { watch as j, ref as pe, nextTick as ls, onUnmounted as Ut, computed as C, onMounted as $t, openBlock as at, createElementBlock as cs, createCommentVNode as wt, createElementVNode as us, onBeforeMount as ds, defineComponent as V, h as d, withDirectives as ps, vShow as ms, inject as Ze, useModel as fs, onBeforeUnmount as hs, createBlock as vt, unref as bt, withCtx as yt, createVNode as gs, mergeModels as vs } from "vue";
3
+ import { Platform as Ct, useQuasar as bs, QBtn as qt, QSeparator as ve } from "quasar";
4
+ import { CBaseButton as me, CColorPickerPopup as ys, CExpansion as Ve, CToggle as Ht, CSlider as We, CBaseButtons as Jt, CDraggableDrawer as De, CDraggableDrawers as Ss, CToolPage as xs } from "@figurosity/consumer-controls";
5
+ import { defineStore as Ye, storeToRefs as N, getActivePinia as ws } from "pinia";
6
6
  import * as I from "three";
7
- import Ze from "lodash.isequal";
8
- import { SKINS as ye, COLORS as se, GRID as Se, LIGHTS as de, RELATED as xe, getConfig as vs, useDynamicImages as ys, DEFAULT as Nt } from "@figurosity/toolbox";
9
- import { OrbitControls as Ss } from "three/examples/jsm/controls/OrbitControls.js";
7
+ import Qe from "lodash.isequal";
8
+ import { DEFAULT as lt, SKINS as xe, COLORS as oe, GRID as we, LIGHTS as de, RELATED as Ce, getConfig as Cs, useDynamicImages as Es } from "@figurosity/toolbox";
10
9
  import "three/examples/jsm/loaders/RGBELoader.js";
11
- import { RoomEnvironment as xs } from "three/examples/jsm/environments/RoomEnvironment.js";
12
- import { mergeVertices as Bt, mergeGeometries as Cs } from "three/examples/jsm/utils/BufferGeometryUtils.js";
13
- import { RoundedBoxGeometry as ws } from "three/examples/jsm/geometries/RoundedBoxGeometry.js";
14
- import { GLTFLoader as Es } from "three/examples/jsm/loaders/GLTFLoader.js";
15
- import { DRACOLoader as Is } from "three/examples/jsm/loaders/DRACOLoader.js";
16
- const Ms = "tool:switched", Ds = "pose:viewed", Ts = "skin:changed", gt = new I.Vector3(), zt = (e) => {
10
+ import { RoomEnvironment as Is } from "three/examples/jsm/environments/RoomEnvironment.js";
11
+ import { OrbitControls as Ds } from "three/examples/jsm/controls/OrbitControls.js";
12
+ import { mergeVertices as Rt, mergeGeometries as ks } from "three/examples/jsm/utils/BufferGeometryUtils.js";
13
+ import { RoundedBoxGeometry as Ts } from "three/examples/jsm/geometries/RoundedBoxGeometry.js";
14
+ import { GLTFLoader as Ms } from "three/examples/jsm/loaders/GLTFLoader.js";
15
+ import { DRACOLoader as As } from "three/examples/jsm/loaders/DRACOLoader.js";
16
+ const Bs = "tool:switched", zs = "pose:viewed", Ps = "skin:changed", St = new I.Vector3(), Vt = (e) => {
17
17
  const t = new I.Box3().setFromObject(e);
18
18
  console.log("box", t);
19
- const s = t.getSize(new I.Vector3()), i = new I.Vector3(
19
+ const s = t.getSize(new I.Vector3()), n = new I.Vector3(
20
20
  (t.min.x + t.max.x) / 2,
21
21
  (t.min.y + t.max.y) / 2,
22
22
  (t.min.z + t.max.z) / 2
23
23
  );
24
- console.log("center", i);
24
+ console.log("center", n);
25
25
  let r = t.min.y;
26
- return console.log("bottom", r), Math.abs(r) < -0.01 && (r = ks(e)), console.log("bottom", r), {
26
+ return console.log("bottom", r), Math.abs(r) < -0.01 && (r = Ls(e)), console.log("bottom", r), {
27
27
  box: t,
28
28
  size: s,
29
- center: i,
29
+ center: n,
30
30
  bottom: r,
31
31
  top: t.max.y
32
32
  };
33
- }, ks = (e) => {
33
+ }, Ls = (e) => {
34
34
  let t = 1 / 0;
35
35
  return e.updateMatrixWorld(!0), e.traverse((s) => {
36
- var r, n;
36
+ var r, i;
37
37
  if (!s.isMesh) return;
38
- const i = (n = (r = s.geometry) == null ? void 0 : r.attributes) == null ? void 0 : n.position;
39
- if (i)
40
- for (let o = 0; o < i.count; o++)
41
- gt.fromBufferAttribute(i, o), gt.applyMatrix4(s.matrixWorld), t = Math.min(t, gt.y);
38
+ const n = (i = (r = s.geometry) == null ? void 0 : r.attributes) == null ? void 0 : i.position;
39
+ if (n)
40
+ for (let o = 0; o < n.count; o++)
41
+ St.fromBufferAttribute(n, o), St.applyMatrix4(s.matrixWorld), t = Math.min(t, St.y);
42
42
  }), t;
43
- }, Ht = (e) => ({
43
+ }, Kt = (e) => ({
44
44
  box: {
45
45
  min: {
46
46
  x: e.box.min.x,
@@ -65,7 +65,7 @@ const Ms = "tool:switched", Ds = "pose:viewed", Ts = "skin:changed", gt = new I.
65
65
  },
66
66
  bottom: e.bottom,
67
67
  top: e.top
68
- }), qt = "smooth", As = (e) => ({
68
+ }), Wt = "smooth", Rs = (e) => ({
69
69
  id: e.id,
70
70
  uuid: e.uuid ?? null,
71
71
  basePoseId: e.basePoseId ?? null,
@@ -77,21 +77,21 @@ const Ms = "tool:switched", Ds = "pose:viewed", Ts = "skin:changed", gt = new I.
77
77
  poseId: e.poseId ?? null,
78
78
  url: e.glbPathWebp || e.glbPath || null,
79
79
  bounds: e.bounds ?? null
80
- }), me = Xe("3d-glbs", {
80
+ }), fe = Ye("3d-glbs", {
81
81
  state: () => ({
82
82
  models: {}
83
83
  }),
84
84
  getters: {
85
85
  selectedId() {
86
- return A().selected;
86
+ return M().selected;
87
87
  },
88
88
  poseId(e) {
89
- var s, i;
90
- const t = A().selected;
91
- return (i = (s = e.models) == null ? void 0 : s[t]) == null ? void 0 : i.poseId;
89
+ var s, n;
90
+ const t = M().selected;
91
+ return (n = (s = e.models) == null ? void 0 : s[t]) == null ? void 0 : n.poseId;
92
92
  },
93
93
  model(e) {
94
- const t = A().selected;
94
+ const t = M().selected;
95
95
  return t && e.models[t] ? e.models[t] : null;
96
96
  },
97
97
  url() {
@@ -105,139 +105,169 @@ const Ms = "tool:switched", Ds = "pose:viewed", Ts = "skin:changed", gt = new I.
105
105
  },
106
106
  actions: {
107
107
  setBounds(e) {
108
- const t = A().selected;
109
- this.models[t] && (this.models[t].bounds = Ht(e));
108
+ const t = M().selected;
109
+ this.models[t] && (this.models[t].bounds = Kt(e));
110
110
  },
111
111
  setSubjectsFromResponse(e) {
112
- var i;
113
- const t = ((i = e == null ? void 0 : e.entities) == null ? void 0 : i.glb) || {}, s = {};
112
+ var n;
113
+ const t = ((n = e == null ? void 0 : e.entities) == null ? void 0 : n.glb) || {}, s = {};
114
114
  return Object.keys(t).forEach((r) => {
115
- s[r] = As(t[r]);
115
+ s[r] = Rs(t[r]);
116
116
  }), this.models = { ...this.models, ...s }, this.selectDefaultGlbId(e);
117
117
  },
118
118
  // Picks the GLB id whose skin slug matches DEFAULT_SKIN_SLUG, falls
119
119
  // back to result.glb[0], or null when no GLBs are available.
120
120
  selectDefaultGlbId(e) {
121
- var o, l, a;
121
+ var o, c, a;
122
122
  const t = Array.isArray((o = e == null ? void 0 : e.result) == null ? void 0 : o.glb) ? e.result.glb : [];
123
123
  if (t.length === 0) return null;
124
- const s = ((l = e == null ? void 0 : e.entities) == null ? void 0 : l.skins) || {}, i = ((a = e == null ? void 0 : e.entities) == null ? void 0 : a.glb) || {}, n = t.find((u) => {
125
- var D, w;
126
- const p = (D = i[u]) == null ? void 0 : D.skinId;
127
- return p != null && ((w = s[p]) == null ? void 0 : w.slug) === qt;
124
+ const s = ((c = e == null ? void 0 : e.entities) == null ? void 0 : c.skins) || {}, n = ((a = e == null ? void 0 : e.entities) == null ? void 0 : a.glb) || {}, i = t.find((u) => {
125
+ var P, w;
126
+ const p = (P = n[u]) == null ? void 0 : P.skinId;
127
+ return p != null && ((w = s[p]) == null ? void 0 : w.slug) === Wt;
128
128
  }) ?? t[0];
129
- return typeof n == "string" ? parseInt(n, 10) : n;
129
+ return typeof i == "string" ? parseInt(i, 10) : i;
130
130
  }
131
131
  }
132
132
  });
133
- function Ye(e) {
133
+ function et(e) {
134
134
  const t = e.startsWith("#") ? e.slice(1) : e;
135
135
  return parseInt(t, 16);
136
136
  }
137
137
  function ue(e) {
138
138
  return `#${e.toString(16).padStart(6, "0")}`;
139
139
  }
140
- const Qe = ({
140
+ const tt = ({
141
141
  storeId: e,
142
142
  defaultValues: t = {},
143
143
  state: s = {},
144
- getters: i = {},
144
+ getters: n = {},
145
145
  actions: r = {},
146
- keyBy: n = "selected"
147
- }) => Xe(e, {
146
+ keyBy: i = "selected"
147
+ }) => Ye(e, {
148
148
  state: () => ({
149
149
  loading: !1,
150
150
  models: {},
151
+ // Bumped by `restore()` so callers outside the lib (the
152
+ // consumer-app's `useViewerUrlSync` ?v= apply path) can trigger
153
+ // a re-apply into three.js. Stores whose state already flows
154
+ // through reactive watchers (grid/scene/ground) ignore this; the
155
+ // ones that don't (controls, lights orbit) use it as the only
156
+ // signal that the host did a `restore()` and the three.js camera
157
+ // needs to be re-driven from the store. See ThreeDimensionTool
158
+ // for the watcher and the rationale.
159
+ applyRevision: 0,
151
160
  ...s
152
161
  }),
153
162
  getters: {
154
163
  keyId() {
155
- return A()[n];
164
+ return M()[i];
156
165
  },
157
166
  model(o) {
158
- return o.models[A()[n]];
167
+ return o.models[M()[i]];
159
168
  },
160
169
  exists(o) {
161
- return typeof o.models[A()[n]] < "u";
170
+ return typeof o.models[M()[i]] < "u";
162
171
  },
163
172
  selectedModel(o) {
164
- return o.models[A()[n]] ?? null;
173
+ return o.models[M()[i]] ?? null;
165
174
  },
166
175
  mergedModel() {
167
176
  return { ...t, ...this.selectedModel ?? {} };
168
177
  },
169
178
  propertyById(o) {
170
- return (l, a, u = null) => o.models[l] && a in o.models[l] ? o.models[l][a] : u;
179
+ return (c, a, u = null) => o.models[c] && a in o.models[c] ? o.models[c][a] : u;
171
180
  },
172
181
  propertyChangedById() {
173
- return (o, l) => this.propertyById(o, l) !== t[l];
182
+ return (o, c) => this.propertyById(o, c) !== t[c];
174
183
  },
175
184
  propertyChanged(o) {
176
- const l = A()[n];
177
- return (a) => o.models[l] ? this.propertyById(l, a) !== t[a] : !1;
185
+ const c = M()[i];
186
+ return (a) => o.models[c] ? this.propertyById(c, a) !== t[a] : !1;
178
187
  },
179
188
  property() {
180
- const o = A()[n];
181
- return (l, a = t[l]) => this.propertyById(o, l, a);
189
+ const o = M()[i];
190
+ return (c, a = t[c]) => this.propertyById(o, c, a);
182
191
  },
183
- ...i
192
+ ...n
184
193
  },
185
194
  actions: {
186
195
  initModel(o) {
187
- o != null && (typeof this.models[o] < "u" || this.$patch((l) => {
188
- l.models[o] = { ...t };
196
+ o != null && (typeof this.models[o] < "u" || this.$patch((c) => {
197
+ c.models[o] = { ...t };
189
198
  }));
190
199
  },
191
200
  ensureSelectedModel() {
192
- const o = A()[n];
201
+ const o = M()[i];
193
202
  return o == null ? null : (this.models[o] || (this.models[o] = { ...t }), this.models[o]);
194
203
  },
195
- setPropertyById(o, l, a) {
204
+ setPropertyById(o, c, a) {
196
205
  o != null && (this.models[o] || this.initModel(o), this.$patch({
197
206
  models: {
198
- [o]: { ...this.models[o], [l]: a }
207
+ [o]: { ...this.models[o], [c]: a }
199
208
  }
200
209
  }));
201
210
  },
202
- setProperty(o, l) {
203
- const a = A()[n];
211
+ setProperty(o, c) {
212
+ const a = M()[i];
204
213
  a != null && (this.models[a] || this.initModel(a), this.$patch({
205
214
  models: {
206
- [a]: { ...this.models[a], [o]: l }
215
+ [a]: { ...this.models[a], [o]: c }
207
216
  }
208
217
  }));
209
218
  },
210
219
  patchSelected(o) {
211
- const l = this.ensureSelectedModel();
212
- l && Object.assign(l, o);
220
+ const c = this.ensureSelectedModel();
221
+ c && Object.assign(c, o);
213
222
  },
214
223
  reset() {
215
- const o = A()[n];
216
- o != null && this.$patch((l) => {
217
- l.models[o] = { ...t };
224
+ const o = M()[i];
225
+ o != null && this.$patch((c) => {
226
+ c.models[o] = { ...t };
218
227
  });
219
228
  },
220
229
  resetProperty(o) {
221
- const l = A()[n];
222
- l != null && this.models[l] && this.$patch({
230
+ const c = M()[i];
231
+ c != null && this.models[c] && this.$patch({
223
232
  models: {
224
- [l]: {
225
- ...this.models[l],
233
+ [c]: {
234
+ ...this.models[c],
226
235
  [o]: t[o]
227
236
  }
228
237
  }
229
238
  });
230
239
  },
240
+ // Capture the active model's tunable state as a plain object. Used
241
+ // by the save+freeze flow (consumer-app `composeViewState`) and the
242
+ // URL `?v=` writer in `useViewerUrlSync` to encode the current view.
243
+ // Returns null when there's no active bucket so the caller can omit
244
+ // the slot from the payload rather than encode a stale snapshot.
245
+ snapshot() {
246
+ const o = M()[i];
247
+ return o == null || !this.models[o] ? null : JSON.parse(JSON.stringify(this.models[o]));
248
+ },
249
+ // Apply a snapshot from the save+freeze payload back onto the
250
+ // active bucket. Missing keys fall through to defaultValues; the
251
+ // caller passes the same shape `snapshot()` produced.
252
+ restore(o) {
253
+ if (o == null || typeof o != "object") return;
254
+ const c = M()[i];
255
+ if (c == null) return;
256
+ const a = JSON.parse(JSON.stringify(o));
257
+ this.$patch((u) => {
258
+ u.models[c] = { ...t, ...a }, u.framed && (u.framed[c] = !0), u.applyRevision = (u.applyRevision || 0) + 1;
259
+ });
260
+ },
231
261
  ...r
232
262
  }
233
- }), Kt = {
263
+ }), Xt = {
234
264
  visible: !0,
235
265
  opacity: 1,
236
266
  color: 16711422,
237
267
  texture: "none"
238
- }, Bs = {
268
+ }, Vs = {
239
269
  changed() {
240
- return this.exists ? !Ze(this.mergedModel, Kt) : !1;
270
+ return this.exists ? !Qe(this.mergedModel, Xt) : !1;
241
271
  },
242
272
  color() {
243
273
  return this.property("color");
@@ -254,7 +284,7 @@ const Qe = ({
254
284
  visible() {
255
285
  return this.property("visible");
256
286
  }
257
- }, zs = {
287
+ }, Fs = {
258
288
  init() {
259
289
  this.initModel(this.keyId);
260
290
  },
@@ -262,7 +292,7 @@ const Qe = ({
262
292
  this.setProperty("color", e);
263
293
  },
264
294
  setColorHex(e) {
265
- this.setProperty("color", Ye(e));
295
+ this.setProperty("color", et(e));
266
296
  },
267
297
  setTexture(e) {
268
298
  this.setProperty("texture", e);
@@ -270,33 +300,33 @@ const Qe = ({
270
300
  setVisible(e) {
271
301
  this.setProperty("visible", e);
272
302
  }
273
- }, Ve = Qe({
303
+ }, Fe = tt({
274
304
  storeId: "3d-ground",
275
- defaultValues: Kt,
305
+ defaultValues: Xt,
276
306
  state: { offset: -0.75 },
277
- getters: Bs,
278
- actions: zs,
307
+ getters: Vs,
308
+ actions: Fs,
279
309
  keyBy: "basePoseId"
280
- }), Ls = {
310
+ }), _s = {
281
311
  color: 16777215,
282
312
  visible: !0,
283
313
  debug: !1,
284
314
  shadow: !0,
285
315
  visualization: !0
286
- }, Be = 0, te = 1, yt = 1.25, St = 3, et = (e, t, s) => Math.max(t, Math.min(s, e)), Ps = 1.25, ze = (e = {}) => ({ ...Ls, ...e }), Ae = {
316
+ }, Pe = 0, se = 1, Et = 1.25, It = 3, ot = (e, t, s) => Math.max(t, Math.min(s, e)), Gs = 1.25, Le = (e = {}) => ({ ..._s, ...e }), ze = {
287
317
  advanced: !1,
288
318
  move: !1,
289
319
  position: { x: 0, y: 0, z: 1.5 },
290
320
  quaternion: { x: 0, y: 0, z: 0, w: 1 },
291
321
  target: { x: 0, y: 0, z: 0 }
292
- }, Lt = ["advanced", "move"], tt = (e = {}) => ({ ...Ae, ...e }), Vs = {
293
- ambientScale: te,
294
- userScale: te
295
- }, st = (e = {}) => ({ ...Vs, ...e }), bt = () => ({
296
- key: ze(),
297
- fill: ze({ shadow: !0 }),
298
- back: ze({ shadow: !0 })
299
- }), fe = Xe("3d-lights", {
322
+ }, Ft = ["advanced", "move"], nt = (e = {}) => ({ ...ze, ...e }), js = {
323
+ ambientScale: se,
324
+ userScale: se
325
+ }, rt = (e = {}) => ({ ...js, ...e }), xt = () => ({
326
+ key: Le(),
327
+ fill: Le({ shadow: !0 }),
328
+ back: Le({ shadow: !0 })
329
+ }), he = Ye("3d-lights", {
300
330
  state: () => ({
301
331
  lights: {},
302
332
  options: {},
@@ -308,14 +338,23 @@ const Qe = ({
308
338
  // doesn't depend on whether option fields happen to look default.
309
339
  framed: {},
310
340
  collection: ["key", "fill", "back"],
311
- debug: !1
341
+ debug: !1,
342
+ // Bumped by `restore()` so ThreeDimensionTool can detect that the
343
+ // host (consumer-app's tier-3 ?v= save-load) pushed new state in,
344
+ // and re-activate lights/camera modes to drive the OrbitControls
345
+ // rig from the just-restored options/lights/scales slots. The
346
+ // intensity sliders and per-spot color watchers fire on slot
347
+ // mutations directly, but the rig position (in options.position/
348
+ // quaternion/target/radius) only flows through `applyFromStore`
349
+ // and needs the explicit re-activation signal.
350
+ applyRevision: 0
312
351
  }),
313
352
  getters: {
314
353
  bpId() {
315
- return A().basePoseId;
354
+ return M().basePoseId;
316
355
  },
317
356
  skinId() {
318
- return A().selected;
357
+ return M().selected;
319
358
  },
320
359
  // The reset button reflects "user has tweaked something on the
321
360
  // active skin." Toggles + rig are per-basePose; sliders are
@@ -325,10 +364,10 @@ const Qe = ({
325
364
  // toggles + the active skin's slider values count.
326
365
  changed(e) {
327
366
  const t = e.options[this.bpId];
328
- if (t && Lt.some((i) => !Ze(t[i], Ae[i])))
367
+ if (t && Ft.some((n) => !Qe(t[n], ze[n])))
329
368
  return !0;
330
369
  const s = e.scales[this.skinId];
331
- return !!(s && (s.ambientScale !== te || s.userScale !== te));
370
+ return !!(s && (s.ambientScale !== se || s.userScale !== se));
332
371
  },
333
372
  // Has frameToBounds + syncToStore landed on this basePose's
334
373
  // lights rig? Set by markFramed() from the bounds watcher in
@@ -351,34 +390,34 @@ const Qe = ({
351
390
  // above the new AMBIENT_SCALE_MAX / USER_SCALE_MAX.
352
391
  ambientScale(e) {
353
392
  var s;
354
- const t = ((s = e.scales[this.skinId]) == null ? void 0 : s.ambientScale) ?? te;
355
- return et(t, Be, yt);
393
+ const t = ((s = e.scales[this.skinId]) == null ? void 0 : s.ambientScale) ?? se;
394
+ return ot(t, Pe, Et);
356
395
  },
357
396
  userScale(e) {
358
397
  var s;
359
- const t = ((s = e.scales[this.skinId]) == null ? void 0 : s.userScale) ?? te;
360
- return et(t, Be, St);
398
+ const t = ((s = e.scales[this.skinId]) == null ? void 0 : s.userScale) ?? se;
399
+ return ot(t, Pe, It);
361
400
  },
362
401
  position(e) {
363
402
  var t;
364
- return ((t = e.options[this.bpId]) == null ? void 0 : t.position) || Ae.position;
403
+ return ((t = e.options[this.bpId]) == null ? void 0 : t.position) || ze.position;
365
404
  },
366
405
  quaternion(e) {
367
406
  var t;
368
- return ((t = e.options[this.bpId]) == null ? void 0 : t.quaternion) || Ae.quaternion;
407
+ return ((t = e.options[this.bpId]) == null ? void 0 : t.quaternion) || ze.quaternion;
369
408
  },
370
409
  target(e) {
371
410
  var t;
372
- return ((t = e.options[this.bpId]) == null ? void 0 : t.target) || Ae.target;
411
+ return ((t = e.options[this.bpId]) == null ? void 0 : t.target) || ze.target;
373
412
  },
374
413
  radius(e) {
375
414
  var t;
376
415
  return (t = e.options[this.bpId]) == null ? void 0 : t.radius;
377
416
  },
378
417
  property(e) {
379
- return (t, s = null, i = null) => {
418
+ return (t, s = null, n = null) => {
380
419
  const r = e.lights[this.bpId];
381
- return !r || !r[t] || !(s in r[t]) ? i : r[t][s];
420
+ return !r || !r[t] || !(s in r[t]) ? n : r[t][s];
382
421
  };
383
422
  },
384
423
  colorHex(e) {
@@ -398,13 +437,13 @@ const Qe = ({
398
437
  reset() {
399
438
  const e = this.bpId, t = this.skinId;
400
439
  if (e == null) return;
401
- this.options[e] || (this.options[e] = tt()), Lt.forEach((i) => this.options[e][i] = Ae[i]), t != null && (this.scales[t] || (this.scales[t] = st()), this.scales[t].ambientScale = te, this.scales[t].userScale = te);
440
+ this.options[e] || (this.options[e] = nt()), Ft.forEach((n) => this.options[e][n] = ze[n]), t != null && (this.scales[t] || (this.scales[t] = rt()), this.scales[t].ambientScale = se, this.scales[t].userScale = se);
402
441
  const s = this.seeds[t];
403
442
  s ? this.lights[e] = {
404
443
  key: { ...s.key },
405
444
  fill: { ...s.fill },
406
445
  back: { ...s.back }
407
- } : this.lights[e] = bt();
446
+ } : this.lights[e] = xt();
408
447
  },
409
448
  // Seed per-skin lights from the recipe and warm the per-basePose
410
449
  // user-state buckets if absent. The recipe is always rewritten
@@ -414,24 +453,24 @@ const Qe = ({
414
453
  // survives subsequent skin swaps within the same basePose.
415
454
  // scales[skinId] is per-skin and warmed once per skin.
416
455
  seedFromRecipe(e, t) {
417
- const s = ((t == null ? void 0 : t.spotIntensity) ?? 1) * Ps, i = (t == null ? void 0 : t.ambientIntensity) ?? 0, r = (t == null ? void 0 : t.envIntensity) ?? 1;
456
+ const s = ((t == null ? void 0 : t.spotIntensity) ?? 1) * Gs, n = (t == null ? void 0 : t.ambientIntensity) ?? 0, r = (t == null ? void 0 : t.envIntensity) ?? 1;
418
457
  this.seeds[e] = {
419
- key: ze({ intensity: s }),
420
- fill: ze({ intensity: s, shadow: !0 }),
421
- back: ze({ intensity: s, shadow: !0 }),
422
- ambient: { intensity: i },
458
+ key: Le({ intensity: s }),
459
+ fill: Le({ intensity: s, shadow: !0 }),
460
+ back: Le({ intensity: s, shadow: !0 }),
461
+ ambient: { intensity: n },
423
462
  env: { intensity: r }
424
- }, e != null && !this.scales[e] && (this.scales[e] = st());
425
- const n = this.bpId;
426
- n != null && (this.lights[n] || (this.lights[n] = bt()), this.options[n] || (this.options[n] = tt()));
463
+ }, e != null && !this.scales[e] && (this.scales[e] = rt());
464
+ const i = this.bpId;
465
+ i != null && (this.lights[i] || (this.lights[i] = xt()), this.options[i] || (this.options[i] = nt()));
427
466
  },
428
467
  ensureSelectedOptions() {
429
468
  const e = this.bpId;
430
- return e == null ? null : (this.options[e] || (this.options[e] = tt()), this.options[e]);
469
+ return e == null ? null : (this.options[e] || (this.options[e] = nt()), this.options[e]);
431
470
  },
432
471
  ensureSelectedScales() {
433
472
  const e = this.skinId;
434
- return e == null ? null : (this.scales[e] || (this.scales[e] = st()), this.scales[e]);
473
+ return e == null ? null : (this.scales[e] || (this.scales[e] = rt()), this.scales[e]);
435
474
  },
436
475
  setControlProperty(e, t) {
437
476
  const s = this.ensureSelectedOptions();
@@ -464,63 +503,85 @@ const Qe = ({
464
503
  return;
465
504
  }
466
505
  s.advanced = !1;
467
- const i = this.lights[t];
468
- if (!i) return;
469
- const r = i.key;
470
- this.collection.forEach((n) => {
471
- n !== "key" && (i[n].color = r.color);
506
+ const n = this.lights[t];
507
+ if (!n) return;
508
+ const r = n.key;
509
+ this.collection.forEach((i) => {
510
+ i !== "key" && (n[i].color = r.color);
472
511
  });
473
512
  },
474
513
  setColorHex(e, t) {
475
- var n;
514
+ var i;
476
515
  this.initLights();
477
516
  const s = this.bpId;
478
517
  if (s == null) return;
479
- const i = this.lights[s];
480
- if (!i) return;
481
- const r = Ye(t);
482
- if (((n = this.options[s]) == null ? void 0 : n.advanced) === !0) {
483
- i[e].color = r;
518
+ const n = this.lights[s];
519
+ if (!n) return;
520
+ const r = et(t);
521
+ if (((i = this.options[s]) == null ? void 0 : i.advanced) === !0) {
522
+ n[e].color = r;
484
523
  return;
485
524
  }
486
525
  this.collection.forEach((o) => {
487
- i[o].color = r;
526
+ n[o].color = r;
488
527
  });
489
528
  },
490
529
  setProperty(e, t, s) {
491
530
  this.initLights();
492
- const i = this.bpId;
493
- if (i == null) return;
494
- const r = this.lights[i];
531
+ const n = this.bpId;
532
+ if (n == null) return;
533
+ const r = this.lights[n];
495
534
  r && (r[e][t] = s);
496
535
  },
497
536
  setAmbientScale(e) {
498
537
  this.initLights();
499
538
  const t = this.ensureSelectedScales();
500
- t && (t.ambientScale = et(e, Be, yt));
539
+ t && (t.ambientScale = ot(e, Pe, Et));
501
540
  },
502
541
  setUserScale(e) {
503
542
  this.initLights();
504
543
  const t = this.ensureSelectedScales();
505
- t && (t.userScale = et(e, Be, St));
544
+ t && (t.userScale = ot(e, Pe, It));
506
545
  },
507
546
  initLights() {
508
547
  const e = this.bpId, t = this.skinId;
509
- t != null && !this.scales[t] && (this.scales[t] = st()), e != null && (this.lights[e] || (this.lights[e] = bt()), this.options[e] || (this.options[e] = tt()));
548
+ t != null && !this.scales[t] && (this.scales[t] = rt()), e != null && (this.lights[e] || (this.lights[e] = xt()), this.options[e] || (this.options[e] = nt()));
510
549
  },
511
550
  markFramed() {
512
551
  const e = this.bpId;
513
552
  e != null && (this.framed[e] = !0);
553
+ },
554
+ // Capture the active basePose + skin's tunable lighting state for
555
+ // the save+freeze flow. Skips `seeds` (per-skin recipe baselines —
556
+ // rewritten on every GLB load, not user state) and `framed` (a
557
+ // session flag, not view-state). The three returned slots match
558
+ // exactly what `restore()` writes back.
559
+ //
560
+ // lights — per-spot color/visible/shadow for the active basePose
561
+ // options — rig position/quaternion/target/radius + toggles
562
+ // scales — ambient/user intensity sliders for the active skin
563
+ // only (per "skip per-skin transfer" rule — saves don't
564
+ // carry maps across skins).
565
+ snapshot() {
566
+ const e = this.bpId, t = this.skinId;
567
+ if (e == null) return null;
568
+ const s = this.lights[e] ? JSON.parse(JSON.stringify(this.lights[e])) : null, n = this.options[e] ? JSON.parse(JSON.stringify(this.options[e])) : null, r = t != null && this.scales[t] ? JSON.parse(JSON.stringify(this.scales[t])) : null;
569
+ return !s && !n && !r ? null : { lights: s, options: n, scales: r };
570
+ },
571
+ restore(e) {
572
+ if (e == null || typeof e != "object") return;
573
+ const t = this.bpId, s = this.skinId;
574
+ t != null && (e.lights && (this.lights = { ...this.lights, [t]: JSON.parse(JSON.stringify(e.lights)) }), e.options && (this.options = { ...this.options, [t]: JSON.parse(JSON.stringify(e.options)) }), e.scales && s != null && (this.scales = { ...this.scales, [s]: JSON.parse(JSON.stringify(e.scales)) }), this.framed[t] = !0, this.applyRevision = (this.applyRevision || 0) + 1);
514
575
  }
515
576
  }
516
- }), Wt = {
577
+ }), Zt = {
517
578
  position: { x: 0, y: 0.39999999999999986, z: 1.5 },
518
579
  quaternion: { x: -0.12993279108591813, y: 0, z: 0, w: 0.9915228034698058 },
519
580
  target: { x: 0, y: 0, z: 0 },
520
581
  radius: 1.5
521
- }, Rs = {
582
+ }, Os = {
522
583
  changed() {
523
- return this.exists ? !Ze(this.mergedModel, Wt) : !1;
584
+ return this.exists ? !Qe(this.mergedModel, Zt) : !1;
524
585
  },
525
586
  // Has frameToBounds + syncToStore landed on this basePose's
526
587
  // bucket? An explicit per-basePose flag, set by markFramed() from
@@ -546,7 +607,7 @@ const Qe = ({
546
607
  radius() {
547
608
  return this.mergedModel.radius;
548
609
  }
549
- }, Gs = {
610
+ }, Ns = {
550
611
  initControls() {
551
612
  this.initModel(this.keyId);
552
613
  },
@@ -566,36 +627,36 @@ const Qe = ({
566
627
  setRadius(e) {
567
628
  this.setProperty("radius", e);
568
629
  }
569
- }, ct = Qe({
630
+ }, pt = tt({
570
631
  storeId: "3d-controls",
571
- defaultValues: Wt,
632
+ defaultValues: Zt,
572
633
  state: { framed: {} },
573
- getters: Rs,
574
- actions: Gs,
634
+ getters: Os,
635
+ actions: Ns,
575
636
  keyBy: "basePoseId"
576
- }), Fs = {
637
+ }), Us = {
577
638
  color: 16711422
578
- }, _s = {
639
+ }, $s = {
579
640
  changed() {
580
641
  return this.propertyChanged("color");
581
642
  },
582
643
  colorHex() {
583
644
  return ue(this.property("color"));
584
645
  }
585
- }, js = {
646
+ }, qs = {
586
647
  init() {
587
648
  this.initModel(this.keyId);
588
649
  },
589
650
  setColorHex(e) {
590
- this.setProperty("color", Ye(e));
651
+ this.setProperty("color", et(e));
591
652
  }
592
- }, ut = Qe({
653
+ }, mt = tt({
593
654
  storeId: "3d-scene",
594
- defaultValues: Fs,
595
- getters: _s,
596
- actions: js,
655
+ defaultValues: Us,
656
+ getters: $s,
657
+ actions: qs,
597
658
  keyBy: "basePoseId"
598
- }), Xt = {
659
+ }), Yt = {
599
660
  show: !1,
600
661
  front: !1,
601
662
  back: !1,
@@ -606,9 +667,9 @@ const Qe = ({
606
667
  divisions: 6,
607
668
  opacity: 0.5,
608
669
  size: 2
609
- }, Us = {
670
+ }, Hs = {
610
671
  changed() {
611
- return !Ze(this.mergedModel, Xt);
672
+ return !Qe(this.mergedModel, Yt);
612
673
  },
613
674
  show() {
614
675
  return this.property("show");
@@ -622,17 +683,17 @@ const Qe = ({
622
683
  divisions() {
623
684
  return this.property("divisions");
624
685
  }
625
- }, Os = {
686
+ }, Js = {
626
687
  init() {
627
688
  this.initModel(this.keyId);
628
689
  }
629
- }, Ee = Qe({
690
+ }, ke = tt({
630
691
  storeId: "3d-grid",
631
- defaultValues: Xt,
632
- getters: Us,
633
- actions: Os,
692
+ defaultValues: Yt,
693
+ getters: Hs,
694
+ actions: Js,
634
695
  keyBy: "basePoseId"
635
- }), $s = [
696
+ }), Ks = [
636
697
  "#141111",
637
698
  "#3E251E",
638
699
  "#633C30",
@@ -673,47 +734,154 @@ const Qe = ({
673
734
  "#BDACA8",
674
735
  "#DACDC9",
675
736
  "#E5E4E3"
676
- ], Ct = "background", wt = "subject", Et = "ground", Zt = {
677
- [wt]: 16711422,
678
- [Ct]: 16777215,
679
- [Et]: 12961221
680
- }, Ns = {
737
+ ], Dt = "background", kt = "subject", Tt = "ground", Qt = {
738
+ [kt]: 16711422,
739
+ [Dt]: 16777215,
740
+ [Tt]: 12961221
741
+ }, Ws = {
681
742
  changed() {
682
- return this.exists ? !Ze(this.mergedModel, Zt) : !1;
743
+ return this.exists ? !Qe(this.mergedModel, Qt) : !1;
683
744
  },
684
745
  subjectHex() {
685
- return ue(this.property(wt));
746
+ return ue(this.property(kt));
686
747
  },
687
748
  groundHex() {
688
- return ue(this.property(Et));
749
+ return ue(this.property(Tt));
689
750
  },
690
751
  backgroundHex() {
691
- return ue(this.property(Ct));
752
+ return ue(this.property(Dt));
692
753
  },
693
754
  getHexColor() {
694
755
  return (e) => ue(this.property(e, "#F0F0F0"));
695
756
  }
696
- }, Hs = {
757
+ }, Xs = {
697
758
  setHexColor(e, t) {
698
- this.setProperty(e, Ye(t));
759
+ this.setProperty(e, et(t));
699
760
  },
700
761
  setSubjectHex(e) {
701
- this.setHexColor(wt, e);
762
+ this.setHexColor(kt, e);
702
763
  },
703
764
  setGroundHex(e) {
704
- this.setHexColor(Et, e);
765
+ this.setHexColor(Tt, e);
705
766
  },
706
767
  setBackgroundHex(e) {
707
- this.setHexColor(Ct, e);
768
+ this.setHexColor(Dt, e);
708
769
  }
709
- }, It = Qe({
770
+ }, Mt = tt({
710
771
  storeId: "3d-colors",
711
- defaultValues: Zt,
712
- state: { palette: $s },
713
- getters: Ns,
714
- actions: Hs,
772
+ defaultValues: Qt,
773
+ state: { palette: Ks },
774
+ getters: Ws,
775
+ actions: Xs,
715
776
  keyBy: "basePoseId"
716
- }), A = Xe("3d", {
777
+ });
778
+ let ee = null, Ge = null;
779
+ const Re = () => {
780
+ const e = M(), { aspect: t, width: s, height: n } = N(e), r = (c = { x: 0, y: 0.8, z: 1.5 }) => (console.debug("useCamera init"), ee ? (console.debug("view camera already inited"), ee) : (ee = new I.PerspectiveCamera(75, t.value, 0.1, 100), e.loaded.camera = !0, ee)), i = () => {
781
+ if (ee)
782
+ return ee;
783
+ };
784
+ return Ge = j(
785
+ () => t.value,
786
+ (c) => {
787
+ if (!ee) {
788
+ r();
789
+ return;
790
+ }
791
+ ee.aspect = c, ee.updateProjectionMatrix();
792
+ }
793
+ ), {
794
+ init: r,
795
+ getCamera: i,
796
+ dispose: () => {
797
+ Ge == null || Ge(), Ge = null, ee = null;
798
+ }
799
+ };
800
+ };
801
+ let W = null, be = null, ye = null, je = null;
802
+ const Ie = () => {
803
+ const e = mt(), t = M(), { colorHex: s } = N(e), n = () => (console.debug("useScene init"), W ? (console.debug("scene already inited"), W) : (W = new I.Scene(), i(s.value), t.loaded.scene = !0, W)), r = () => {
804
+ if (W)
805
+ return W;
806
+ }, i = (a) => {
807
+ if (!W) throw new Error("Scene has not been initialized");
808
+ W.background = new I.Color(a);
809
+ }, o = (a) => {
810
+ if (!W) throw new Error("Scene has not been initialized");
811
+ if (!a) throw new Error("Renderer required to build environment");
812
+ be || (ye = new I.PMREMGenerator(a), ye.compileEquirectangularShader(), be = ye.fromScene(new Is(), 0.04).texture, W.environment = be);
813
+ };
814
+ return je = j(
815
+ () => s.value,
816
+ (a) => i(a)
817
+ ), {
818
+ init: n,
819
+ get: r,
820
+ dispose: () => {
821
+ t.loaded.scene = !1, je == null || je(), je = null, W && (W.traverse((a) => {
822
+ var u, p;
823
+ a.isMesh && ((u = a.geometry) == null || u.dispose(), Array.isArray(a.material) ? a.material.forEach((P) => P == null ? void 0 : P.dispose()) : (p = a.material) == null || p.dispose());
824
+ }), W.clear(), W = null, be == null || be.dispose(), ye == null || ye.dispose(), be = null, ye = null);
825
+ },
826
+ setBackgroundColor: i,
827
+ setEnvironment: o
828
+ };
829
+ };
830
+ let L = null, Oe = null, Ne = null;
831
+ const Xe = () => {
832
+ const e = M(), { get: t } = Ie(), { getCamera: s } = Re(), { width: n, height: r, subjectLoaded: i } = N(e);
833
+ function o(w) {
834
+ return console.debug("useRenderer init"), L ? (console.debug("renderer already inited"), L) : (L = new I.WebGLRenderer({ antialias: !0, alpha: !0, preserveDrawingBuffer: !0 }), L.setSize(n.value, r.value), L.toneMapping = I.ACESFilmicToneMapping, L.toneMappingExposure = 0.8, L.shadowMap.enabled = !0, L.shadowMap.type = I.PCFSoftShadowMap, L.outputColorSpace = I.SRGBColorSpace, w && w.appendChild(L.domElement), e.loaded.renderer = !0, L);
835
+ }
836
+ const c = () => {
837
+ if (!L) throw new Error("Renderer has not been initialized");
838
+ return L;
839
+ }, a = (w) => {
840
+ L && (L.toneMappingExposure = w);
841
+ }, u = () => {
842
+ const w = t(), m = s();
843
+ !w || !m || L.render(w, m);
844
+ };
845
+ async function p({ size: w = 1024, format: m = "jpeg", quality: g = 0.85 } = {}) {
846
+ if (!L) throw new Error("Renderer has not been initialized");
847
+ const y = t(), x = s();
848
+ if (!y || !x) throw new Error("Scene or camera not ready");
849
+ const v = L.getSize(new I.Vector2()), k = L.getPixelRatio(), R = x.aspect;
850
+ try {
851
+ L.setPixelRatio(1), L.setSize(w, w, !1), x.aspect = 1, x.updateProjectionMatrix(), L.render(y, x);
852
+ const F = m === "png" ? "image/png" : "image/jpeg";
853
+ return await new Promise(($, K) => {
854
+ L.domElement.toBlob(
855
+ (b) => b ? $(b) : K(new Error("toBlob returned null")),
856
+ F,
857
+ m === "jpeg" ? g : void 0
858
+ );
859
+ });
860
+ } finally {
861
+ L.setPixelRatio(k), L.setSize(v.x, v.y, !1), x.aspect = R, x.updateProjectionMatrix(), L.render(y, x);
862
+ }
863
+ }
864
+ Oe = j(
865
+ () => [n.value, r.value],
866
+ ([w, m]) => {
867
+ !w || !m || !L || L.setSize(w, m);
868
+ }
869
+ ), Ne = j(
870
+ () => i.value,
871
+ () => u()
872
+ );
873
+ function P() {
874
+ console.debug("renderer disposed"), e.loaded.renderer = !1, Oe == null || Oe(), Ne == null || Ne(), Oe = null, Ne = null, L && (L.domElement.parentElement && L.domElement.parentElement.removeChild(L.domElement), L.dispose(), L = null);
875
+ }
876
+ return {
877
+ init: o,
878
+ get: c,
879
+ dispose: P,
880
+ render: u,
881
+ setExposure: a,
882
+ captureSnapshot: p
883
+ };
884
+ }, M = Ye("3d", {
717
885
  state: () => ({
718
886
  // models: {},
719
887
  selected: null,
@@ -745,11 +913,16 @@ const Qe = ({
745
913
  }),
746
914
  getters: {
747
915
  active(e) {
748
- var t, s;
749
- return ((s = (t = this.models) == null ? void 0 : t[e.selected]) == null ? void 0 : s.active) || ye;
916
+ var s, n;
917
+ const t = Ct.is.mobile ? lt : xe;
918
+ return ((n = (s = this.models) == null ? void 0 : s[e.selected]) == null ? void 0 : n.active) || t;
750
919
  },
751
920
  aspect(e) {
752
921
  return e.height > 0 ? e.width / e.height : 0;
922
+ },
923
+ isFrozen(e) {
924
+ var t;
925
+ return ((t = this.appFreezeStore) == null ? void 0 : t.isFrozen(e.basePoseId)) || !1;
753
926
  }
754
927
  },
755
928
  actions: {
@@ -761,6 +934,13 @@ const Qe = ({
761
934
  var t;
762
935
  return ((t = this.appPaywallStore) == null ? void 0 : t.block(e)) || !0;
763
936
  },
937
+ pokeFreeze() {
938
+ var e;
939
+ (e = this.appFreezeStore) == null || e.poke(this.basePoseId);
940
+ },
941
+ captureSnapshot(e) {
942
+ return Xe().captureSnapshot(e);
943
+ },
764
944
  isExpanded(e = []) {
765
945
  return e = Array.isArray(e) ? e : [e], e.includes(this.active);
766
946
  },
@@ -774,116 +954,93 @@ const Qe = ({
774
954
  });
775
955
  },
776
956
  setFromResponse(e) {
777
- var u, p, D;
778
- const t = It(), s = ct(), i = Ee(), r = Ve(), n = fe(), o = ut(), a = me().setSubjectsFromResponse(e);
957
+ var u, p, P;
958
+ const t = Mt(), s = pt(), n = ke(), r = Fe(), i = he(), o = mt(), a = fe().setSubjectsFromResponse(e);
779
959
  if (this.setUuid = ((u = e == null ? void 0 : e.result) == null ? void 0 : u.setUuid) ?? null, this.basePoseId = ((p = e == null ? void 0 : e.result) == null ? void 0 : p.basePoseId) ?? null, a == null) {
780
960
  this.selected = null;
781
961
  return;
782
962
  }
783
- this.selected = a, t.initModel(this.basePoseId), n.initLights(), r.init(), s.initControls(), i.init(), o.init(), this.models[a] || (this.models[a] = {}), (D = this.models[a]) != null && D.active || (this.models[a].active = ye);
963
+ this.selected = a, t.initModel(this.basePoseId), i.initLights(), r.init(), s.initControls(), n.init(), o.init(), this.models[a] || (this.models[a] = {}), (P = this.models[a]) != null && P.active || (this.models[a].active = Ct.is.mobile ? lt : xe);
784
964
  }
785
965
  }
786
966
  });
787
- let J = null, Ge = null;
788
- const Le = () => {
789
- const e = A(), { aspect: t, width: s, height: i } = $(e), r = (l = { x: 0, y: 0.8, z: 1.5 }) => (console.debug("useCamera init"), J ? (console.debug("view camera already inited"), J) : (J = new I.PerspectiveCamera(75, t.value, 0.1, 100), e.loaded.camera = !0, J)), n = () => {
790
- if (J)
791
- return J;
792
- };
793
- return Ge = O(
794
- () => t.value,
795
- (l) => {
796
- if (!J) {
797
- r();
798
- return;
799
- }
800
- J.aspect = l, J.updateProjectionMatrix();
801
- }
802
- ), {
803
- init: r,
804
- getCamera: n,
805
- dispose: () => {
806
- Ge == null || Ge(), Ge = null, J = null;
807
- }
808
- };
809
- };
810
967
  let Q = null;
811
- const rt = () => {
968
+ const ct = () => {
812
969
  const e = pe(!1), t = pe({
813
970
  mode: null,
814
971
  camera: null,
815
972
  // camera (or your lights-camera)
816
973
  store: null
817
974
  // pinia store with position/quaternion/target
818
- }), s = (h, f = {}) => {
975
+ }), s = (m, g = {}) => {
819
976
  if (console.debug("useOrbitControlsBase init"), Q)
820
977
  return console.debug("controls already inited"), Q;
821
- const S = new I.Object3D();
822
- return Q = new Ss(S, h.domElement), r(f), Q;
823
- }, i = () => {
978
+ const y = new I.Object3D();
979
+ return Q = new Ds(y, m.domElement), r(g), Q;
980
+ }, n = () => {
824
981
  if (!Q) throw new Error("OrbitControls not initialized");
825
982
  return Q;
826
- }, r = (h = {}) => {
827
- const f = i();
828
- f.enableDamping = h.enableDamping ?? !0, f.dampingFactor = h.dampingFactor ?? 0.5, f.rotateSpeed = h.rotateSpeed ?? 0.2, f.enableZoom = h.enableZoom ?? !0, f.minDistance = h.minDistance ?? 0.5, f.maxDistance = h.maxDistance ?? 6, f.panSpeed = h.panSpeed ?? 1;
829
- }, n = ({ mode: h, camera: f, store: S, options: E }) => {
830
- const y = i();
831
- if (!f) throw new Error(`setMode(${h}): camera is required`);
832
- if (!S) throw new Error(`setMode(${h}): store is required`);
833
- y.object = f, r(E), t.value = { mode: h, camera: f, store: S }, a(), y.update();
983
+ }, r = (m = {}) => {
984
+ const g = n();
985
+ g.enableDamping = m.enableDamping ?? !0, g.dampingFactor = m.dampingFactor ?? 0.5, g.rotateSpeed = m.rotateSpeed ?? 0.2, g.enableZoom = m.enableZoom ?? !0, g.minDistance = m.minDistance ?? 0.5, g.maxDistance = m.maxDistance ?? 6, g.panSpeed = m.panSpeed ?? 1;
986
+ }, i = ({ mode: m, camera: g, store: y, options: x }) => {
987
+ const v = n();
988
+ if (!g) throw new Error(`setMode(${m}): camera is required`);
989
+ if (!y) throw new Error(`setMode(${m}): store is required`);
990
+ v.object = g, r(x), t.value = { mode: m, camera: g, store: y }, a(), v.update();
834
991
  }, o = () => {
835
992
  Q && Q.update();
836
- }, l = () => {
837
- const h = i(), { camera: f, store: S } = t.value;
838
- !f || !S || e.value || (S.setPosition({ ...f.position }), S.setQuaternion({ ...f.quaternion }), S.setTarget({ ...h.target }), S.setRadius(f.position.distanceTo(h.target)));
993
+ }, c = () => {
994
+ const m = n(), { camera: g, store: y } = t.value;
995
+ !g || !y || e.value || (y.setPosition({ ...g.position }), y.setQuaternion({ ...g.quaternion }), y.setTarget({ ...m.target }), y.setRadius(g.position.distanceTo(m.target)));
839
996
  }, a = () => {
840
- const h = i(), { camera: f, store: S } = t.value;
841
- if (!f || !S) return;
997
+ const m = n(), { camera: g, store: y } = t.value;
998
+ if (!g || !y) return;
842
999
  e.value = !0;
843
- const { position: E, quaternion: y, target: T, radius: P } = S;
844
- h.target.set(T.x, T.y, T.z);
845
- const G = new I.Vector3(
846
- E.x - T.x,
847
- E.y - T.y,
848
- E.z - T.z
1000
+ const { position: x, quaternion: v, target: k, radius: R } = y;
1001
+ m.target.set(k.x, k.y, k.z);
1002
+ const F = new I.Vector3(
1003
+ x.x - k.x,
1004
+ x.y - k.y,
1005
+ x.z - k.z
849
1006
  ).normalize();
850
- f.position.copy(h.target).add(G.multiplyScalar(P)), f.quaternion.set(
851
- y.x,
852
- y.y,
853
- y.z,
854
- y.w
855
- ), h.update(), e.value = !1;
1007
+ g.position.copy(m.target).add(F.multiplyScalar(R)), g.quaternion.set(
1008
+ v.x,
1009
+ v.y,
1010
+ v.z,
1011
+ v.w
1012
+ ), m.update(), e.value = !1;
856
1013
  }, u = 0, p = 0.1;
857
1014
  return {
858
1015
  init: s,
859
- get: i,
860
- setMode: n,
1016
+ get: n,
1017
+ setMode: i,
861
1018
  update: o,
862
- syncToStore: l,
1019
+ syncToStore: c,
863
1020
  applyFromStore: a,
864
- frameToBounds: (h, f = 1.75) => {
865
- const S = i(), { camera: E } = t.value;
866
- if (!E || !h) return;
867
- const y = new I.Vector3(
868
- h.center.x,
869
- h.center.y + h.size.y * u,
870
- h.center.z
1021
+ frameToBounds: (m, g = 1.75) => {
1022
+ const y = n(), { camera: x } = t.value;
1023
+ if (!x || !m) return;
1024
+ const v = new I.Vector3(
1025
+ m.center.x,
1026
+ m.center.y + m.size.y * u,
1027
+ m.center.z
871
1028
  );
872
- console.log("bounds", h);
873
- const T = Math.max(h.size.x, h.size.y, h.size.z), P = I.MathUtils.degToRad(E.fov);
874
- let G = T / 2 / Math.tan(P / 2) * f;
875
- S.target.copy(y), E.position.set(
876
- y.x,
877
- y.y + h.size.y * p,
878
- y.z + G
879
- ), E.near = G / 100, E.far = G * 100, E.updateProjectionMatrix(), S.update();
1029
+ console.log("bounds", m);
1030
+ const k = Math.max(m.size.x, m.size.y, m.size.z), R = I.MathUtils.degToRad(x.fov);
1031
+ let F = k / 2 / Math.tan(R / 2) * g;
1032
+ y.target.copy(v), x.position.set(
1033
+ v.x,
1034
+ v.y + m.size.y * p,
1035
+ v.z + F
1036
+ ), x.near = F / 100, x.far = F * 100, x.updateProjectionMatrix(), y.update();
880
1037
  },
881
1038
  dispose: () => {
882
1039
  console.debug("controls disposed"), Q && (Q.dispose(), Q = null, t.value = { mode: null, camera: null, store: null });
883
1040
  }
884
1041
  };
885
- }, Mt = () => {
886
- const { getCamera: e } = Le(), t = ct(), s = rt();
1042
+ }, At = () => {
1043
+ const { getCamera: e } = Re(), t = pt(), s = ct();
887
1044
  return {
888
1045
  activate: () => {
889
1046
  s.setMode({
@@ -901,36 +1058,7 @@ const rt = () => {
901
1058
  syncToStore: s.syncToStore,
902
1059
  applyFromStore: s.applyFromStore
903
1060
  };
904
- };
905
- let X = null, ge = null, be = null, Fe = null;
906
- const we = () => {
907
- const e = ut(), t = A(), { colorHex: s } = $(e), i = () => (console.debug("useScene init"), X ? (console.debug("scene already inited"), X) : (X = new I.Scene(), n(s.value), t.loaded.scene = !0, X)), r = () => {
908
- if (X)
909
- return X;
910
- }, n = (a) => {
911
- if (!X) throw new Error("Scene has not been initialized");
912
- X.background = new I.Color(a);
913
- }, o = (a) => {
914
- if (!X) throw new Error("Scene has not been initialized");
915
- if (!a) throw new Error("Renderer required to build environment");
916
- ge || (be = new I.PMREMGenerator(a), be.compileEquirectangularShader(), ge = be.fromScene(new xs(), 0.04).texture, X.environment = ge);
917
- };
918
- return Fe = O(
919
- () => s.value,
920
- (a) => n(a)
921
- ), {
922
- init: i,
923
- get: r,
924
- dispose: () => {
925
- t.loaded.scene = !1, Fe == null || Fe(), Fe = null, X && (X.traverse((a) => {
926
- var u, p;
927
- a.isMesh && ((u = a.geometry) == null || u.dispose(), Array.isArray(a.material) ? a.material.forEach((D) => D == null ? void 0 : D.dispose()) : (p = a.material) == null || p.dispose());
928
- }), X.clear(), X = null, ge == null || ge.dispose(), be == null || be.dispose(), ge = null, be = null);
929
- },
930
- setBackgroundColor: n,
931
- setEnvironment: o
932
- };
933
- }, qs = {
1061
+ }, Zs = {
934
1062
  asphalt: {
935
1063
  ao: "ao.jpg",
936
1064
  color: "color.jpg",
@@ -966,280 +1094,280 @@ const we = () => {
966
1094
  repeat: 100
967
1095
  }
968
1096
  };
969
- let k = null, _e = null, je = null, Ue = null;
970
- const Pt = () => {
971
- const e = Ve(), { get: t } = we(), { getCamera: s } = Le(), {
972
- visible: i,
1097
+ let A = null, Ue = null, $e = null, qe = null;
1098
+ const _t = () => {
1099
+ const e = Fe(), { get: t } = Ie(), { getCamera: s } = Re(), {
1100
+ visible: n,
973
1101
  color: r,
974
- texture: n,
1102
+ texture: i,
975
1103
  offset: o
976
- } = $(e), l = () => {
977
- if (console.debug("useGround init"), k)
978
- return console.debug("ground already inited"), k;
979
- const f = t(), S = new I.PlaneGeometry(100, 100), E = new I.Color(r.value || 16777215), y = new I.MeshStandardMaterial({
980
- color: E,
1104
+ } = N(e), c = () => {
1105
+ if (console.debug("useGround init"), A)
1106
+ return console.debug("ground already inited"), A;
1107
+ const g = t(), y = new I.PlaneGeometry(100, 100), x = new I.Color(r.value || 16777215), v = new I.MeshStandardMaterial({
1108
+ color: x,
981
1109
  // Default to white
982
1110
  side: I.DoubleSide,
983
1111
  roughness: 0.4,
984
1112
  metalness: 0.3,
985
- emissive: E,
1113
+ emissive: x,
986
1114
  emissiveIntensity: 0.05
987
1115
  // tweak 0.1–0.6
988
1116
  });
989
- return k = new I.Mesh(S, y), k.rotation.x = -Math.PI / 2, k.receiveShadow = !0, k.visible = i.value, f.add(k), _e = O(
990
- () => i.value,
1117
+ return A = new I.Mesh(y, v), A.rotation.x = -Math.PI / 2, A.receiveShadow = !0, A.visible = n.value, g.add(A), Ue = j(
1118
+ () => n.value,
991
1119
  () => a()
992
- ), je = O(
1120
+ ), $e = j(
993
1121
  () => r.value,
994
- (T) => w(T)
995
- ), Ue = O(
996
- () => n.value,
997
- (T) => p(T)
998
- ), k;
1122
+ (k) => w(k)
1123
+ ), qe = j(
1124
+ () => i.value,
1125
+ (k) => p(k)
1126
+ ), A;
999
1127
  };
1000
1128
  function a() {
1001
- if (s().position.y < k.position.y) {
1002
- k.visible = !1;
1129
+ if (s().position.y < A.position.y) {
1130
+ A.visible = !1;
1003
1131
  return;
1004
1132
  }
1005
- k.visible = i.value;
1133
+ A.visible = n.value;
1006
1134
  }
1007
- function u(f, S = 1, E = 1) {
1008
- return new I.TextureLoader().load(f, (P) => {
1009
- P.wrapS = I.RepeatWrapping, P.wrapT = I.RepeatWrapping, P.repeat.set(S, E), P.needsUpdate = !0;
1135
+ function u(g, y = 1, x = 1) {
1136
+ return new I.TextureLoader().load(g, (R) => {
1137
+ R.wrapS = I.RepeatWrapping, R.wrapT = I.RepeatWrapping, R.repeat.set(y, x), R.needsUpdate = !0;
1010
1138
  });
1011
1139
  }
1012
- const p = (f) => {
1013
- if (!k) throw new Error("Ground has not been initialized");
1014
- const S = qs[f];
1015
- if (!S)
1016
- k.material.map = null, k.material.normalMap = null, k.material.displacementMap = null, k.material.roughnessMap = null, k.material.aoMap = null, k.material.metalnessMap = null, k.material.needsUpdate = !0;
1140
+ const p = (g) => {
1141
+ if (!A) throw new Error("Ground has not been initialized");
1142
+ const y = Zs[g];
1143
+ if (!y)
1144
+ A.material.map = null, A.material.normalMap = null, A.material.displacementMap = null, A.material.roughnessMap = null, A.material.aoMap = null, A.material.metalnessMap = null, A.material.needsUpdate = !0;
1017
1145
  else {
1018
- const E = `https://static.figurosity.com/3d/textures/${f}/`, y = S.repeat;
1019
- k.material.map = u(
1020
- `${E}${S.color}`,
1021
- y,
1022
- y
1023
- ), k.material.normalMap = u(
1024
- `${E}${S.normal}`,
1025
- y,
1026
- y
1027
- ), k.material.displacementMap = u(
1028
- `${E}${S.displacement}`,
1029
- y,
1030
- y
1031
- ), k.material.roughnessMap = u(
1032
- `${E}${S.roughness}`,
1033
- y,
1034
- y
1035
- ), k.material.aoMap = u(
1036
- `${E}${S.ao}`,
1037
- y,
1038
- y
1039
- ), S.metalness && (k.material.metalnessMap = u(
1040
- `${E}${S.metalness}`,
1041
- y,
1042
- y
1043
- )), k.material.displacementScale = 0.1, k.material.displacementBias = -0.05, k.material.needsUpdate = !0;
1146
+ const x = `https://static.figurosity.com/3d/textures/${g}/`, v = y.repeat;
1147
+ A.material.map = u(
1148
+ `${x}${y.color}`,
1149
+ v,
1150
+ v
1151
+ ), A.material.normalMap = u(
1152
+ `${x}${y.normal}`,
1153
+ v,
1154
+ v
1155
+ ), A.material.displacementMap = u(
1156
+ `${x}${y.displacement}`,
1157
+ v,
1158
+ v
1159
+ ), A.material.roughnessMap = u(
1160
+ `${x}${y.roughness}`,
1161
+ v,
1162
+ v
1163
+ ), A.material.aoMap = u(
1164
+ `${x}${y.ao}`,
1165
+ v,
1166
+ v
1167
+ ), y.metalness && (A.material.metalnessMap = u(
1168
+ `${x}${y.metalness}`,
1169
+ v,
1170
+ v
1171
+ )), A.material.displacementScale = 0.1, A.material.displacementBias = -0.05, A.material.needsUpdate = !0;
1044
1172
  }
1045
- k.position.y = o.value, k.geometry.computeBoundingBox(), k.geometry.computeVertexNormals();
1046
- }, D = () => {
1047
- if (!k) throw new Error("Ground has not been initialized");
1048
- return k;
1049
- }, w = (f) => {
1050
- if (!k) throw new Error("Ground has not been initialized");
1051
- k.material.color.set(f);
1173
+ A.position.y = o.value, A.geometry.computeBoundingBox(), A.geometry.computeVertexNormals();
1174
+ }, P = () => {
1175
+ if (!A) throw new Error("Ground has not been initialized");
1176
+ return A;
1177
+ }, w = (g) => {
1178
+ if (!A) throw new Error("Ground has not been initialized");
1179
+ A.material.color.set(g);
1052
1180
  };
1053
- return { init: l, get: D, setColor: w, updateVisibility: a, dispose: () => {
1054
- var S, E;
1055
- if (_e == null || _e(), je == null || je(), Ue == null || Ue(), _e = null, je = null, Ue = null, !k) return;
1056
- const f = t();
1057
- f == null || f.remove(k), (S = k.geometry) == null || S.dispose(), Array.isArray(k.material) ? k.material.forEach((y) => y == null ? void 0 : y.dispose()) : (E = k.material) == null || E.dispose(), k = null;
1181
+ return { init: c, get: P, setColor: w, updateVisibility: a, dispose: () => {
1182
+ var y, x;
1183
+ if (Ue == null || Ue(), $e == null || $e(), qe == null || qe(), Ue = null, $e = null, qe = null, !A) return;
1184
+ const g = t();
1185
+ g == null || g.remove(A), (y = A.geometry) == null || y.dispose(), Array.isArray(A.material) ? A.material.forEach((v) => v == null ? void 0 : v.dispose()) : (x = A.material) == null || x.dispose(), A = null;
1058
1186
  } };
1059
- }, Ks = (e, t = 16711422) => {
1060
- const s = new ws(0.1, 0.1, 0.1, 6, 0.01), i = 0.1, r = 0.05, n = new I.ConeGeometry(r, i, 32);
1187
+ }, Ys = (e, t = 16711422) => {
1188
+ const s = new Ts(0.1, 0.1, 0.1, 6, 0.01), n = 0.1, r = 0.05, i = new I.ConeGeometry(r, n, 32);
1061
1189
  s.index || s.setIndex(
1062
1190
  Array.from(
1063
1191
  { length: s.attributes.position.count },
1064
1192
  (u, p) => p
1065
1193
  )
1066
- ), n.index || n.setIndex(
1194
+ ), i.index || i.setIndex(
1067
1195
  Array.from(
1068
- { length: n.attributes.position.count },
1196
+ { length: i.attributes.position.count },
1069
1197
  (u, p) => p
1070
1198
  )
1071
- ), n.rotateX(-Math.PI / 2), n.translate(0, 0, i / 2), Bt(s), Bt(n);
1072
- const o = Cs([s, n]), l = new I.MeshBasicMaterial({
1199
+ ), i.rotateX(-Math.PI / 2), i.translate(0, 0, n / 2), Rt(s), Rt(i);
1200
+ const o = ks([s, i]), c = new I.MeshBasicMaterial({
1073
1201
  color: t,
1074
1202
  transparent: !0,
1075
1203
  opacity: 0.8
1076
- }), a = new I.Mesh(o, l);
1204
+ }), a = new I.Mesh(o, c);
1077
1205
  if (a.position.set(0, 0, 0), a.rotateX(Math.PI), e && e.target) {
1078
1206
  const u = new I.Vector3();
1079
1207
  e.target.getWorldPosition(u), a.lookAt(u);
1080
1208
  }
1081
1209
  return a.position.copy(e.position), a;
1082
1210
  };
1083
- let ot = {}, ne = {}, N = {}, ie = {}, Me = null, ae = null, De = [], Te = /* @__PURE__ */ new Map();
1084
- const it = () => {
1085
- const e = A(), t = fe(), s = me();
1211
+ let it = {}, ne = {}, q = {}, ie = {}, Te = null, ae = null, Me = [], Ae = /* @__PURE__ */ new Map();
1212
+ const ut = () => {
1213
+ const e = M(), t = he(), s = fe();
1086
1214
  pe(!1);
1087
- const { subjectLoaded: i, width: r, height: n, selected: o, basePoseId: l } = $(e), { debug: a, collection: u, advancedMode: p, move: D } = $(t), { get: w } = we(), h = t.property, f = () => {
1215
+ const { subjectLoaded: n, width: r, height: i, selected: o, basePoseId: c } = N(e), { debug: a, collection: u, advancedMode: p, move: P } = N(t), { get: w } = Ie(), m = t.property, g = () => {
1088
1216
  if (ae)
1089
1217
  return console.warn("lights camera already inited"), ae;
1090
- const g = w();
1091
- return Me = y(), ae = T(), u.value.forEach((c) => {
1092
- const v = c === "key" ? ae : g, { group: L, light: M, visualization: x } = P(c, v);
1093
- N[c] = M, ot[c] = L, ie[c] = x, N[c].castShadow = !0, N[c].angle = Math.PI / 4, N[c].penumbra = 0.5, N[c].shadow.camera.near = 0.5, N[c].shadow.camera.far = 12, N[c].shadow.focus = 0.9, N[c].shadow.mapSize.set(4096, 4096), N[c].shadow.bias = -2e-4, N[c].shadow.normalBias = 0.02, N[c].shadow.radius = 2, N[c].shadow.camera.updateProjectionMatrix();
1094
- }), F(), Y(), ae;
1095
- }, S = () => {
1218
+ const S = w();
1219
+ return Te = v(), ae = k(), u.value.forEach((l) => {
1220
+ const f = l === "key" ? ae : S, { group: T, light: D, visualization: E } = R(l, f);
1221
+ q[l] = D, it[l] = T, ie[l] = E, q[l].castShadow = !0, q[l].angle = Math.PI / 4, q[l].penumbra = 0.5, q[l].shadow.camera.near = 0.5, q[l].shadow.camera.far = 12, q[l].shadow.focus = 0.9, q[l].shadow.mapSize.set(4096, 4096), q[l].shadow.bias = -2e-4, q[l].shadow.normalBias = 0.02, q[l].shadow.radius = 2, q[l].shadow.camera.updateProjectionMatrix();
1222
+ }), G(), Y(), ae;
1223
+ }, y = () => {
1096
1224
  if (!ae)
1097
1225
  throw new Error("Light camera not initialized.");
1098
1226
  return ae;
1099
- }, E = (g) => {
1100
- g && (Object.values(N).forEach((c) => c == null ? void 0 : c.color.set(g)), Object.values(ie).forEach((c) => {
1101
- var v;
1102
- return (v = c == null ? void 0 : c.material) == null ? void 0 : v.color.set(g);
1227
+ }, x = (S) => {
1228
+ S && (Object.values(q).forEach((l) => l == null ? void 0 : l.color.set(S)), Object.values(ie).forEach((l) => {
1229
+ var f;
1230
+ return (f = l == null ? void 0 : l.material) == null ? void 0 : f.color.set(S);
1103
1231
  }));
1104
- }, y = () => {
1105
- const g = w(), c = new I.AmbientLight(16777215, 0.2);
1106
- return g.add(c), c;
1107
- }, T = () => {
1108
- const g = w(), c = new I.PerspectiveCamera(
1232
+ }, v = () => {
1233
+ const S = w(), l = new I.AmbientLight(16777215, 0.2);
1234
+ return S.add(l), l;
1235
+ }, k = () => {
1236
+ const S = w(), l = new I.PerspectiveCamera(
1109
1237
  75,
1110
- r.value / n.value,
1238
+ r.value / i.value,
1111
1239
  0.1,
1112
1240
  100
1113
1241
  );
1114
- return c.position.set(0, 0, 1.5), g.add(c), c;
1242
+ return l.position.set(0, 0, 1.5), S.add(l), l;
1115
1243
  };
1116
- function P(g, c = null) {
1117
- const v = w(), L = new I.Group(), M = new I.SpotLight(
1118
- h(g, "color"),
1119
- h(g, "intensity")
1244
+ function R(S, l = null) {
1245
+ const f = w(), T = new I.Group(), D = new I.SpotLight(
1246
+ m(S, "color"),
1247
+ m(S, "intensity")
1120
1248
  );
1121
- M.position.set(0, 0, 0), H(), M.target.position.set(0, 1, 0), M.target.updateMatrixWorld(), v.add(M.target), L.add(M);
1122
- const x = Ks(
1123
- M,
1124
- h(g, "visualizationColor")
1125
- ), U = t.isVisible(g);
1126
- return x.visible = U, L.add(x), c.add(L), { group: L, light: M, visualization: x };
1249
+ D.position.set(0, 0, 0), $(), D.target.position.set(0, 1, 0), D.target.updateMatrixWorld(), f.add(D.target), T.add(D);
1250
+ const E = Ys(
1251
+ D,
1252
+ m(S, "visualizationColor")
1253
+ ), O = t.isVisible(S);
1254
+ return E.visible = O, T.add(E), l.add(T), { group: T, light: D, visualization: E };
1127
1255
  }
1128
- const G = () => {
1129
- H(), Z(), b();
1130
- }, H = () => {
1131
- if (!t.lights[l.value]) return;
1132
- const c = t.seeds[o.value], v = t.ambientScale, L = t.userScale;
1133
- if (Me && (c != null && c.ambient) && (Me.intensity = c.ambient.intensity * v), c != null && c.env) {
1134
- const M = w();
1135
- M && (M.environmentIntensity = c.env.intensity * v);
1256
+ const F = () => {
1257
+ $(), K(), b();
1258
+ }, $ = () => {
1259
+ if (!t.lights[c.value]) return;
1260
+ const l = t.seeds[o.value], f = t.ambientScale, T = t.userScale;
1261
+ if (Te && (l != null && l.ambient) && (Te.intensity = l.ambient.intensity * f), l != null && l.env) {
1262
+ const D = w();
1263
+ D && (D.environmentIntensity = l.env.intensity * f);
1136
1264
  }
1137
- u.value.forEach((M) => {
1138
- const x = N[M];
1139
- if (!x) return;
1140
- const U = h(M, "color"), he = h(M, "visible"), K = h(M, "shadow") || !1;
1141
- if (U && x.color.set(U), x.visible = he, c != null && c[M] && (x.intensity = c[M].intensity * L), x.castShadow = K, K) {
1142
- const re = h(M, "shadowSettings", {});
1143
- x.shadow.mapSize.set(
1265
+ u.value.forEach((D) => {
1266
+ const E = q[D];
1267
+ if (!E) return;
1268
+ const O = m(D, "color"), ge = m(D, "visible"), J = m(D, "shadow") || !1;
1269
+ if (O && E.color.set(O), E.visible = ge, l != null && l[D] && (E.intensity = l[D].intensity * T), E.castShadow = J, J) {
1270
+ const re = m(D, "shadowSettings", {});
1271
+ E.shadow.mapSize.set(
1144
1272
  re.width || 1024,
1145
1273
  re.height || 1024
1146
- ), x.shadow.camera.near = re.near || 0.5, x.shadow.camera.far = re.far || 50, x.shadow.needsUpdate = !0;
1274
+ ), E.shadow.camera.near = re.near || 0.5, E.shadow.camera.far = re.far || 50, E.shadow.needsUpdate = !0;
1147
1275
  }
1148
1276
  });
1149
- }, Z = () => {
1150
- t.lights[l.value] && u.value.forEach((c) => {
1151
- if (!ie[c]) return console.warn(`${c} does not exist`);
1152
- const v = t.isVisible(c);
1153
- ie[c].visible = v, ie[c].material.color.set(h(c, "color"));
1277
+ }, K = () => {
1278
+ t.lights[c.value] && u.value.forEach((l) => {
1279
+ if (!ie[l]) return console.warn(`${l} does not exist`);
1280
+ const f = t.isVisible(l);
1281
+ ie[l].visible = f, ie[l].material.color.set(m(l, "color"));
1154
1282
  });
1155
1283
  }, b = () => {
1156
- t.lights[l.value] && u.value.forEach((c) => {
1157
- const v = h(c, "debug") || a.value;
1158
- !ne[c] && v && (ne[c] = m(c, N[c]), N[c].add(ne[c])), ne[c] && !v && (ne[c] = B(ne[c]));
1284
+ t.lights[c.value] && u.value.forEach((l) => {
1285
+ const f = m(l, "debug") || a.value;
1286
+ !ne[l] && f && (ne[l] = h(l, q[l]), q[l].add(ne[l])), ne[l] && !f && (ne[l] = B(ne[l]));
1159
1287
  });
1160
- }, m = (g, c) => {
1161
- const v = w(), L = new I.SpotLightHelper(
1162
- c,
1163
- h(g, "visualizationColor")
1288
+ }, h = (S, l) => {
1289
+ const f = w(), T = new I.SpotLightHelper(
1290
+ l,
1291
+ m(S, "visualizationColor")
1164
1292
  );
1165
- return v.add(L), L;
1166
- }, B = (g) => {
1167
- const c = w();
1168
- if (!(!c || !g))
1169
- return c.remove(g), g.dispose(), g = null, g;
1170
- }, F = () => {
1171
- const g = S();
1293
+ return f.add(T), T;
1294
+ }, B = (S) => {
1295
+ const l = w();
1296
+ if (!(!l || !S))
1297
+ return l.remove(S), S.dispose(), S = null, S;
1298
+ }, G = () => {
1299
+ const S = y();
1172
1300
  if (!s.bounds) return;
1173
- const v = t.target, L = new I.Vector3(v.x, v.y, v.z), M = new I.Vector3().subVectors(L, g.position).normalize(), x = new I.Vector3(
1174
- M.x,
1301
+ const f = t.target, T = new I.Vector3(f.x, f.y, f.z), D = new I.Vector3().subVectors(T, S.position).normalize(), E = new I.Vector3(
1302
+ D.x,
1175
1303
  0,
1176
- M.z
1177
- ).normalize(), U = new I.Vector3(
1178
- -x.z,
1304
+ D.z
1305
+ ).normalize(), O = new I.Vector3(
1306
+ -E.z,
1179
1307
  0,
1180
- x.x
1181
- ), K = 2 * g.position.distanceTo(L) / Math.sqrt(3), re = 1, Re = L.clone().add(U.clone().multiplyScalar(-K / re)).add(M.clone().multiplyScalar(Math.sqrt(3) * K / 2)), os = L.clone().add(U.clone().multiplyScalar(K / re)).add(M.clone().multiplyScalar(Math.sqrt(3) * K / 2));
1182
- ot.fill.position.copy(Re), ot.back.position.copy(os), u.value.forEach((dt) => {
1183
- var kt, Je, At;
1184
- const pt = N[dt];
1185
- pt.shadow.needsUpdate = !0, pt.target.position.copy(L), pt.target.updateMatrixWorld(), (kt = ie[dt]) == null || kt.lookAt(L), (At = (Je = ne[dt]) == null ? void 0 : Je.update) == null || At.call(Je);
1308
+ E.x
1309
+ ), J = 2 * S.position.distanceTo(T) / Math.sqrt(3), re = 1, _e = T.clone().add(O.clone().multiplyScalar(-J / re)).add(D.clone().multiplyScalar(Math.sqrt(3) * J / 2)), as = T.clone().add(O.clone().multiplyScalar(J / re)).add(D.clone().multiplyScalar(Math.sqrt(3) * J / 2));
1310
+ it.fill.position.copy(_e), it.back.position.copy(as), u.value.forEach((ht) => {
1311
+ var Pt, st, Lt;
1312
+ const gt = q[ht];
1313
+ gt.shadow.needsUpdate = !0, gt.target.position.copy(T), gt.target.updateMatrixWorld(), (Pt = ie[ht]) == null || Pt.lookAt(T), (Lt = (st = ne[ht]) == null ? void 0 : st.update) == null || Lt.call(st);
1186
1314
  });
1187
- }, z = (g) => {
1188
- const c = `watcher-${g}`;
1189
- if (Te.has(c)) return;
1190
- const v = O(
1191
- () => [t.lights[g], t.options[g]],
1192
- G,
1315
+ }, z = (S) => {
1316
+ const l = `watcher-${S}`;
1317
+ if (Ae.has(l)) return;
1318
+ const f = j(
1319
+ () => [t.lights[S], t.options[S]],
1320
+ F,
1193
1321
  { deep: !0 }
1194
1322
  );
1195
- Te.set(c, v);
1196
- }, j = (g) => {
1197
- const c = `watcher-${g}`, v = Te.get(c);
1198
- v && (v(), Te.delete(c));
1323
+ Ae.set(l, f);
1324
+ }, U = (S) => {
1325
+ const l = `watcher-${S}`, f = Ae.get(l);
1326
+ f && (f(), Ae.delete(l));
1199
1327
  }, Y = () => {
1200
- De.push(
1201
- O(
1202
- () => [p.value, o.value, D.value],
1203
- () => G()
1328
+ Me.push(
1329
+ j(
1330
+ () => [p.value, o.value, P.value],
1331
+ () => F()
1204
1332
  )
1205
- ), De.push(
1206
- O(
1333
+ ), Me.push(
1334
+ j(
1207
1335
  () => [t.ambientScale, t.userScale],
1208
- () => G()
1336
+ () => F()
1209
1337
  )
1210
- ), De.push(
1211
- O(
1212
- () => i.value,
1213
- (g) => {
1214
- g === !0 && F();
1338
+ ), Me.push(
1339
+ j(
1340
+ () => n.value,
1341
+ (S) => {
1342
+ S === !0 && G();
1215
1343
  }
1216
1344
  )
1217
- ), De.push(
1218
- O(
1219
- () => l.value,
1220
- (g, c) => {
1221
- c && j(c), g != null && (z(g), ns(G));
1345
+ ), Me.push(
1346
+ j(
1347
+ () => c.value,
1348
+ (S, l) => {
1349
+ l && U(l), S != null && (z(S), ls(F));
1222
1350
  },
1223
1351
  { immediate: !0 }
1224
1352
  )
1225
1353
  );
1226
1354
  };
1227
1355
  return {
1228
- init: f,
1229
- updatePosition: F,
1230
- getCamera: S,
1356
+ init: g,
1357
+ updatePosition: G,
1358
+ getCamera: y,
1231
1359
  dispose: () => {
1232
- const g = w();
1233
- g && (De.forEach((c) => c()), De = [], Te.forEach((c) => c()), Te.clear(), Object.values(N).forEach((c) => g.remove(c)), Object.values(ne).forEach((c) => g.remove(c)), Object.values(ie).forEach((c) => {
1234
- var v, L, M, x;
1235
- g.remove(c), (L = (v = c.geometry) == null ? void 0 : v.dispose) == null || L.call(v), (x = (M = c.material) == null ? void 0 : M.dispose) == null || x.call(M);
1236
- }), Me && g.remove(Me), ot = {}, ne = {}, N = {}, ie = {}, Me = null, ae = null);
1237
- },
1238
- applyColorPreview: E,
1239
- applyFromStore: G
1360
+ const S = w();
1361
+ S && (Me.forEach((l) => l()), Me = [], Ae.forEach((l) => l()), Ae.clear(), Object.values(q).forEach((l) => S.remove(l)), Object.values(ne).forEach((l) => S.remove(l)), Object.values(ie).forEach((l) => {
1362
+ var f, T, D, E;
1363
+ S.remove(l), (T = (f = l.geometry) == null ? void 0 : f.dispose) == null || T.call(f), (E = (D = l.material) == null ? void 0 : D.dispose) == null || E.call(D);
1364
+ }), Te && S.remove(Te), it = {}, ne = {}, q = {}, ie = {}, Te = null, ae = null);
1365
+ },
1366
+ applyColorPreview: x,
1367
+ applyFromStore: F
1240
1368
  };
1241
- }, Ws = 0.4, Xs = 0.25, Dt = () => {
1242
- const e = fe(), t = rt(), { getCamera: s } = it();
1369
+ }, Qs = 0.4, eo = 0.25, Bt = () => {
1370
+ const e = he(), t = ct(), { getCamera: s } = ut();
1243
1371
  return {
1244
1372
  activate: () => {
1245
1373
  t.setMode({
@@ -1257,80 +1385,45 @@ const it = () => {
1257
1385
  }
1258
1386
  });
1259
1387
  },
1260
- frameToBounds: (n, o = 1.75) => {
1261
- if (!n) return;
1262
- const l = t.get(), a = s(), u = new I.Vector3(
1263
- n.center.x,
1264
- n.center.y + n.size.y * Ws,
1265
- n.center.z
1266
- ), p = Math.max(n.size.x, n.size.y, n.size.z), D = I.MathUtils.degToRad(a.fov), w = p / 2 / Math.tan(D / 2) * o;
1267
- l.target.copy(u), a.position.set(u.x, u.y + n.size.y * Xs, u.z + w), a.near = w / 100, a.far = w * 100, a.updateProjectionMatrix(), l.update();
1388
+ frameToBounds: (i, o = 1.75) => {
1389
+ if (!i) return;
1390
+ const c = t.get(), a = s(), u = new I.Vector3(
1391
+ i.center.x,
1392
+ i.center.y + i.size.y * Qs,
1393
+ i.center.z
1394
+ ), p = Math.max(i.size.x, i.size.y, i.size.z), P = I.MathUtils.degToRad(a.fov), w = p / 2 / Math.tan(P / 2) * o;
1395
+ c.target.copy(u), a.position.set(u.x, u.y + i.size.y * eo, u.z + w), a.near = w / 100, a.far = w * 100, a.updateProjectionMatrix(), c.update();
1268
1396
  },
1269
1397
  syncToStore: t.syncToStore,
1270
1398
  applyFromStore: t.applyFromStore
1271
1399
  };
1272
1400
  };
1273
1401
  let le = null;
1274
- const Zs = () => {
1402
+ const to = () => {
1275
1403
  const e = () => {
1276
- const s = A();
1277
- return le = new I.LoadingManager(), le.onStart = function(i) {
1278
- s.loading.active = !0, s.loading.url = i, s.loading.percent = 0;
1404
+ const s = M();
1405
+ return le = new I.LoadingManager(), le.onStart = function(n) {
1406
+ s.loading.active = !0, s.loading.url = n, s.loading.percent = 0;
1279
1407
  }, le.onError = () => {
1280
1408
  s.loading.active = !1, s.loading.url = null;
1281
1409
  }, le.onLoad = function() {
1282
1410
  s.loading.active = !1, s.loading.url = null, s.loading.percent = 100;
1283
- }, le.onProgress = function(i, r, n) {
1284
- s.loading.percent = Math.round(r / n * 100);
1411
+ }, le.onProgress = function(n, r, i) {
1412
+ s.loading.percent = Math.round(r / i * 100);
1285
1413
  }, le;
1286
1414
  };
1287
1415
  return { get: () => (le || e(), le) };
1288
- };
1289
- let _ = null, Oe = null, $e = null;
1290
- const at = () => {
1291
- const e = A(), { get: t } = we(), { getCamera: s } = Le(), { width: i, height: r, subjectLoaded: n } = $(e);
1292
- function o(D) {
1293
- return console.debug("useRenderer init"), _ ? (console.debug("renderer already inited"), _) : (_ = new I.WebGLRenderer({ antialias: !0, alpha: !0 }), _.setSize(i.value, r.value), _.toneMapping = I.ACESFilmicToneMapping, _.toneMappingExposure = 0.8, _.shadowMap.enabled = !0, _.shadowMap.type = I.PCFSoftShadowMap, _.outputColorSpace = I.SRGBColorSpace, D && D.appendChild(_.domElement), e.loaded.renderer = !0, _);
1294
- }
1295
- const l = () => {
1296
- if (!_) throw new Error("Renderer has not been initialized");
1297
- return _;
1298
- }, a = (D) => {
1299
- _ && (_.toneMappingExposure = D);
1300
- }, u = () => {
1301
- const D = t(), w = s();
1302
- !D || !w || _.render(D, w);
1303
- };
1304
- Oe = O(
1305
- () => [i.value, r.value],
1306
- ([D, w]) => {
1307
- !D || !w || !_ || _.setSize(D, w);
1308
- }
1309
- ), $e = O(
1310
- () => n.value,
1311
- () => u()
1312
- );
1313
- function p() {
1314
- console.debug("renderer disposed"), e.loaded.renderer = !1, Oe == null || Oe(), $e == null || $e(), Oe = null, $e = null, _ && (_.domElement.parentElement && _.domElement.parentElement.removeChild(_.domElement), _.dispose(), _ = null);
1315
- }
1316
- return {
1317
- init: o,
1318
- get: l,
1319
- dispose: p,
1320
- render: u,
1321
- setExposure: a
1322
- };
1323
- }, Ys = /hair|lash|brow|eye|cornea|sclera|iris|pupil|tear|teeth|tongue|mouth|gum|lip|nail/i, Qs = (e, t, s = {}) => {
1324
- const { removeSpecular: i = !1, removeShininess: r = !1 } = s;
1325
- e && e.traverse((n) => {
1326
- if (!n.isMesh) return;
1327
- (Array.isArray(n.material) ? n.material : [n.material]).forEach((l) => {
1328
- if (!l) return;
1329
- const a = `${n.name} ${l.name || ""}`;
1330
- Ys.test(a) || (l.color && l.color.set(t), i && l.specular && l.specular.set(0), r && typeof l.shininess == "number" && (l.shininess = 0), l.needsUpdate = !0);
1416
+ }, so = /hair|lash|brow|eye|cornea|sclera|iris|pupil|tear|teeth|tongue|mouth|gum|lip|nail/i, oo = (e, t, s = {}) => {
1417
+ const { removeSpecular: n = !1, removeShininess: r = !1 } = s;
1418
+ e && e.traverse((i) => {
1419
+ if (!i.isMesh) return;
1420
+ (Array.isArray(i.material) ? i.material : [i.material]).forEach((c) => {
1421
+ if (!c) return;
1422
+ const a = `${i.name} ${c.name || ""}`;
1423
+ so.test(a) || (c.color && c.color.set(t), n && c.specular && c.specular.set(0), r && typeof c.shininess == "number" && (c.shininess = 0), c.needsUpdate = !0);
1331
1424
  });
1332
1425
  });
1333
- }, Js = 1, eo = "https://www.gstatic.com/draco/v1/decoders/", lt = {
1426
+ }, no = 1, ro = "https://www.gstatic.com/draco/v1/decoders/", dt = {
1334
1427
  roughnessFloor: 0.85,
1335
1428
  metalness: null,
1336
1429
  envMapIntensity: null,
@@ -1339,8 +1432,8 @@ const at = () => {
1339
1432
  ambientIntensity: 0.2,
1340
1433
  spotIntensity: 1,
1341
1434
  envIntensity: 1
1342
- }, to = {
1343
- nude: { ...lt },
1435
+ }, io = {
1436
+ nude: { ...dt },
1344
1437
  // Smooth ships with no texture maps — pure-white sculpting reference.
1345
1438
  // All "detail" has to come from form-revealing shading on the
1346
1439
  // geometry, not from albedo. Same metalness=1 Diffeomorphic bug as
@@ -1349,7 +1442,7 @@ const at = () => {
1349
1442
  // exposure so lit surfaces don't saturate to white. The contrast
1350
1443
  // between lit and unlit faces is what makes form readable.
1351
1444
  smooth: {
1352
- ...lt,
1445
+ ...dt,
1353
1446
  roughnessFloor: 0.3,
1354
1447
  metalness: 0,
1355
1448
  envMapIntensity: 0.02,
@@ -1367,194 +1460,194 @@ const at = () => {
1367
1460
  envIntensity: 1
1368
1461
  }
1369
1462
  };
1370
- let ve = null, ce = null, ke, Vt = 0, ee = lt;
1371
- const Rt = () => {
1372
- const { get: e } = Zs(), t = me(), s = A(), i = Ve(), r = It(), { selected: n } = $(s), { url: o } = $(t), { subjectHex: l } = $(r), { offset: a } = $(i), { getCamera: u } = Le(), { get: p } = we(), { render: D } = at(), w = (y) => {
1373
- const { setExposure: T } = at(), P = fe(), G = ++Vt;
1374
- s.subjectLoaded = !1, h();
1375
- const H = e();
1376
- ce || (ce = new Is(H), ce.setDecoderPath(eo));
1377
- const Z = new Es(H);
1378
- Z.setDRACOLoader(ce), Z.setWithCredentials(!0), Z.manager.setURLModifier((b) => b), Z.load(y, (b) => {
1379
- var g;
1380
- const m = b == null ? void 0 : b.scene;
1381
- if (G !== Vt) {
1382
- m == null || m.traverse((c) => {
1383
- var L;
1384
- if (!c.isMesh) return;
1385
- (L = c.geometry) == null || L.dispose();
1386
- const v = c.material;
1387
- Array.isArray(v) ? v.forEach((M) => M == null ? void 0 : M.dispose()) : v == null || v.dispose();
1463
+ let Se = null, ce = null, Be, Gt = 0, te = dt;
1464
+ const jt = () => {
1465
+ const { get: e } = to(), t = fe(), s = M(), n = Fe(), r = Mt(), { selected: i } = N(s), { url: o } = N(t), { subjectHex: c } = N(r), { offset: a } = N(n), { getCamera: u } = Re(), { get: p } = Ie(), { render: P } = Xe(), w = (v) => {
1466
+ const { setExposure: k } = Xe(), R = he(), F = ++Gt;
1467
+ s.subjectLoaded = !1, m();
1468
+ const $ = e();
1469
+ ce || (ce = new As($), ce.setDecoderPath(ro));
1470
+ const K = new Ms($);
1471
+ K.setDRACOLoader(ce), K.setWithCredentials(!0), K.manager.setURLModifier((b) => b), K.load(v, (b) => {
1472
+ var S;
1473
+ const h = b == null ? void 0 : b.scene;
1474
+ if (F !== Gt) {
1475
+ h == null || h.traverse((l) => {
1476
+ var T;
1477
+ if (!l.isMesh) return;
1478
+ (T = l.geometry) == null || T.dispose();
1479
+ const f = l.material;
1480
+ Array.isArray(f) ? f.forEach((D) => D == null ? void 0 : D.dispose()) : f == null || f.dispose();
1388
1481
  });
1389
1482
  return;
1390
1483
  }
1391
- if (!m)
1484
+ if (!h)
1392
1485
  return;
1393
- ve = m, ee = to[(g = t.model) == null ? void 0 : g.slug] || lt, T(ee.exposure), P.seedFromRecipe(s.selected, ee);
1394
- const B = p(), F = u(), z = new I.Group();
1395
- z.name = "GLBSubject", z.add(m);
1396
- const j = /brow|lash/i;
1397
- m.traverse((c) => {
1398
- if (!c.isMesh) return;
1399
- c.castShadow = !0, c.receiveShadow = !0;
1400
- const v = Array.isArray(c.material) ? c.material : [c.material], L = `${c.name} ${v.map((x) => x == null ? void 0 : x.name).join(" ")}`, M = j.test(L);
1401
- v.forEach((x) => {
1402
- x && (ee.roughnessFloor !== null && typeof x.roughness == "number" && (x.roughness = Math.max(
1403
- x.roughness,
1404
- ee.roughnessFloor
1405
- )), ee.metalness !== null && typeof x.metalness == "number" && (x.metalness = ee.metalness), ee.envMapIntensity !== null && typeof x.envMapIntensity == "number" && (x.envMapIntensity = ee.envMapIntensity), x.transparent && M && (x.alphaTest = 0.2, x.depthWrite = !0), x.needsUpdate = !0);
1486
+ Se = h, te = io[(S = t.model) == null ? void 0 : S.slug] || dt, k(te.exposure), R.seedFromRecipe(s.selected, te);
1487
+ const B = p(), G = u(), z = new I.Group();
1488
+ z.name = "GLBSubject", z.add(h);
1489
+ const U = /brow|lash/i;
1490
+ h.traverse((l) => {
1491
+ if (!l.isMesh) return;
1492
+ l.castShadow = !0, l.receiveShadow = !0;
1493
+ const f = Array.isArray(l.material) ? l.material : [l.material], T = `${l.name} ${f.map((E) => E == null ? void 0 : E.name).join(" ")}`, D = U.test(T);
1494
+ f.forEach((E) => {
1495
+ E && (te.roughnessFloor !== null && typeof E.roughness == "number" && (E.roughness = Math.max(
1496
+ E.roughness,
1497
+ te.roughnessFloor
1498
+ )), te.metalness !== null && typeof E.metalness == "number" && (E.metalness = te.metalness), te.envMapIntensity !== null && typeof E.envMapIntensity == "number" && (E.envMapIntensity = te.envMapIntensity), E.transparent && D && (E.alphaTest = 0.2, E.depthWrite = !0), E.needsUpdate = !0);
1406
1499
  });
1407
- }), ee.applyTint && Qs(m, l.value), m.scale.setScalar(Js), m.updateMatrixWorld(!0);
1408
- const Y = zt(m);
1409
- z.position.y -= Y.bottom, z.updateMatrixWorld(!0), B.add(z), ve = z;
1410
- const q = zt(z);
1411
- t.setBounds(q), D(B, F), s.subjectLoaded = !0;
1500
+ }), te.applyTint && oo(h, c.value), h.scale.setScalar(no), h.updateMatrixWorld(!0);
1501
+ const Y = Vt(h);
1502
+ z.position.y -= Y.bottom, z.updateMatrixWorld(!0), B.add(z), Se = z;
1503
+ const X = Vt(z);
1504
+ t.setBounds(X), P(B, G), s.subjectLoaded = !0;
1412
1505
  });
1413
- }, h = () => {
1414
- if (!ve) return;
1415
- p().remove(ve), ve.traverse((T) => {
1416
- var G;
1417
- if (!T.isMesh) return;
1418
- (G = T.geometry) == null || G.dispose();
1419
- const P = T.material;
1420
- Array.isArray(P) ? P.forEach((H) => H == null ? void 0 : H.dispose()) : P == null || P.dispose();
1421
- }), ve = null, s.subjectLoaded = !1;
1422
- }, f = () => ve, S = () => {
1423
- if (ke) {
1506
+ }, m = () => {
1507
+ if (!Se) return;
1508
+ p().remove(Se), Se.traverse((k) => {
1509
+ var F;
1510
+ if (!k.isMesh) return;
1511
+ (F = k.geometry) == null || F.dispose();
1512
+ const R = k.material;
1513
+ Array.isArray(R) ? R.forEach(($) => $ == null ? void 0 : $.dispose()) : R == null || R.dispose();
1514
+ }), Se = null, s.subjectLoaded = !1;
1515
+ }, g = () => Se, y = () => {
1516
+ if (Be) {
1424
1517
  console.warn("useGLB.init() called more than once");
1425
1518
  return;
1426
1519
  }
1427
- ke = O(
1428
- () => n.value,
1429
- (y, T) => {
1430
- !y || y === T || o.value && w(o.value);
1520
+ Be = j(
1521
+ () => i.value,
1522
+ (v, k) => {
1523
+ !v || v === k || o.value && w(o.value);
1431
1524
  },
1432
1525
  { immediate: !0 }
1433
1526
  );
1434
- }, E = () => {
1435
- ke == null || ke(), ke = null, h(), ce == null || ce.dispose(), ce = null;
1527
+ }, x = () => {
1528
+ Be == null || Be(), Be = null, m(), ce == null || ce.dispose(), ce = null;
1436
1529
  };
1437
- return _t(() => {
1438
- E();
1439
- }), { init: S, get: f, dispose: E };
1440
- }, so = (e, t, s = 500) => {
1441
- const i = e.material;
1442
- i.transparent = !0;
1443
- const r = i.opacity, n = performance.now(), o = (l) => {
1444
- const a = l - n, u = Math.min(a / s, 1), p = r + (t - r) * u;
1445
- i.opacity = p, u < 1 && requestAnimationFrame(o);
1530
+ return Ut(() => {
1531
+ x();
1532
+ }), { init: y, get: g, dispose: x };
1533
+ }, ao = (e, t, s = 500) => {
1534
+ const n = e.material;
1535
+ n.transparent = !0;
1536
+ const r = n.opacity, i = performance.now(), o = (c) => {
1537
+ const a = c - i, u = Math.min(a / s, 1), p = r + (t - r) * u;
1538
+ n.opacity = p, u < 1 && requestAnimationFrame(o);
1446
1539
  };
1447
1540
  requestAnimationFrame(o);
1448
- }, oo = 34815;
1449
- let V = null, Ne = null, He = null, qe = null;
1450
- const Gt = () => {
1451
- const e = Ee(), t = Ve(), s = me(), { show: i, divisions: r, size: n, opacity: o } = $(e), { offset: l } = $(t), { bounds: a } = $(s), { get: u } = we(), p = () => {
1452
- const b = T(oo), m = b, { positions: B, colors: F } = D({
1453
- size: n.value,
1541
+ }, lo = 34815;
1542
+ let _ = null, He = null, Je = null, Ke = null;
1543
+ const Ot = () => {
1544
+ const e = ke(), t = Fe(), s = fe(), { show: n, divisions: r, size: i, opacity: o } = N(e), { offset: c } = N(t), { bounds: a } = N(s), { get: u } = Ie(), p = () => {
1545
+ const b = k(lo), h = b, { positions: B, colors: G } = P({
1546
+ size: i.value,
1454
1547
  divisions: r.value,
1455
1548
  color: b,
1456
- centerColor: m
1457
- }), z = w(B, F), j = h(o.value);
1458
- return new I.LineSegments(z, j);
1459
- }, D = ({ size: b, divisions: m, color: B, centerColor: F }) => {
1460
- const z = b / 2, j = b / m, Y = [], q = [], g = Math.floor(m / 2), c = (v, L, M, x) => {
1461
- Y.push(v, L, M);
1462
- const U = x ? F : B;
1463
- q.push(U.r, U.g, U.b);
1549
+ centerColor: h
1550
+ }), z = w(B, G), U = m(o.value);
1551
+ return new I.LineSegments(z, U);
1552
+ }, P = ({ size: b, divisions: h, color: B, centerColor: G }) => {
1553
+ const z = b / 2, U = b / h, Y = [], X = [], S = Math.floor(h / 2), l = (f, T, D, E) => {
1554
+ Y.push(f, T, D);
1555
+ const O = E ? G : B;
1556
+ X.push(O.r, O.g, O.b);
1464
1557
  };
1465
- for (let v = 0; v <= m; v++) {
1466
- const L = -z + v * j, M = v === g;
1467
- for (let x = 0; x <= m; x++) {
1468
- const U = -z + x * j, K = M || x === g;
1469
- c(-z, L, U, K), c(+z, L, U, K);
1558
+ for (let f = 0; f <= h; f++) {
1559
+ const T = -z + f * U, D = f === S;
1560
+ for (let E = 0; E <= h; E++) {
1561
+ const O = -z + E * U, J = D || E === S;
1562
+ l(-z, T, O, J), l(+z, T, O, J);
1470
1563
  }
1471
1564
  }
1472
- for (let v = 0; v <= m; v++) {
1473
- const L = -z + v * j, M = v === g;
1474
- for (let x = 0; x <= m; x++) {
1475
- const U = -z + x * j, K = M || x === g;
1476
- c(L, -z, U, K), c(L, +z, U, K);
1565
+ for (let f = 0; f <= h; f++) {
1566
+ const T = -z + f * U, D = f === S;
1567
+ for (let E = 0; E <= h; E++) {
1568
+ const O = -z + E * U, J = D || E === S;
1569
+ l(T, -z, O, J), l(T, +z, O, J);
1477
1570
  }
1478
1571
  }
1479
- for (let v = 0; v <= m; v++) {
1480
- const L = -z + v * j, M = v === g;
1481
- for (let x = 0; x <= m; x++) {
1482
- const U = -z + x * j, K = M || x === g;
1483
- c(L, U, -z, K), c(L, U, +z, K);
1572
+ for (let f = 0; f <= h; f++) {
1573
+ const T = -z + f * U, D = f === S;
1574
+ for (let E = 0; E <= h; E++) {
1575
+ const O = -z + E * U, J = D || E === S;
1576
+ l(T, O, -z, J), l(T, O, +z, J);
1484
1577
  }
1485
1578
  }
1486
- return { positions: Y, colors: q };
1487
- }, w = (b, m) => {
1579
+ return { positions: Y, colors: X };
1580
+ }, w = (b, h) => {
1488
1581
  const B = new I.BufferGeometry();
1489
1582
  return B.setAttribute(
1490
1583
  "position",
1491
1584
  new I.Float32BufferAttribute(b, 3)
1492
- ), B.setAttribute("color", new I.Float32BufferAttribute(m, 3)), B;
1493
- }, h = (b) => new I.LineBasicMaterial({
1585
+ ), B.setAttribute("color", new I.Float32BufferAttribute(h, 3)), B;
1586
+ }, m = (b) => new I.LineBasicMaterial({
1494
1587
  transparent: !0,
1495
1588
  opacity: b,
1496
1589
  depthWrite: !1,
1497
1590
  blending: I.NormalBlending,
1498
1591
  vertexColors: !0
1499
- }), f = () => {
1500
- V && y(i.value);
1501
- }, S = () => {
1592
+ }), g = () => {
1593
+ _ && v(n.value);
1594
+ }, y = () => {
1502
1595
  const b = u();
1503
- V = p(), H(), b.add(V), E(0);
1504
- }, E = (b) => {
1505
- V && (V.material.transparent = !0, b = i.value ? b : 0, V.material.opacity = b);
1506
- }, y = (b) => {
1507
- const m = b ? o.value : 0;
1508
- so(V, m, 500);
1509
- }, T = (b) => ({
1596
+ _ = p(), $(), b.add(_), x(0);
1597
+ }, x = (b) => {
1598
+ _ && (_.material.transparent = !0, b = n.value ? b : 0, _.material.opacity = b);
1599
+ }, v = (b) => {
1600
+ const h = b ? o.value : 0;
1601
+ ao(_, h, 500);
1602
+ }, k = (b) => ({
1510
1603
  r: (b >> 16 & 255) / 255,
1511
1604
  g: (b >> 8 & 255) / 255,
1512
1605
  b: (b & 255) / 255
1513
- }), P = (b, m) => {
1514
- if (!V) return;
1515
- const B = T(b), F = T(m), z = V.geometry.attributes.color, j = V.geometry.attributes.position, Y = j.count, q = n.value / 2, g = n.value / r.value, c = Math.floor(r.value / 2);
1516
- for (let v = 0; v < Y; v++) {
1517
- const L = j.getX(v), M = j.getY(v), x = j.getZ(v), U = Math.round((L + q) / g), he = Math.round((M + q) / g), K = Math.round((x + q) / g), Re = U === c || he === c || K === c ? B : F;
1518
- z.setXYZ(v, Re.r, Re.g, Re.b);
1606
+ }), R = (b, h) => {
1607
+ if (!_) return;
1608
+ const B = k(b), G = k(h), z = _.geometry.attributes.color, U = _.geometry.attributes.position, Y = U.count, X = i.value / 2, S = i.value / r.value, l = Math.floor(r.value / 2);
1609
+ for (let f = 0; f < Y; f++) {
1610
+ const T = U.getX(f), D = U.getY(f), E = U.getZ(f), O = Math.round((T + X) / S), ge = Math.round((D + X) / S), J = Math.round((E + X) / S), _e = O === l || ge === l || J === l ? B : G;
1611
+ z.setXYZ(f, _e.r, _e.g, _e.b);
1519
1612
  }
1520
1613
  z.needsUpdate = !0;
1521
- }, G = () => {
1614
+ }, F = () => {
1522
1615
  const b = u();
1523
- V && (b.remove(V), V.geometry.dispose(), V.material.dispose(), V = null), V = p(), H(), b.add(V);
1524
- }, H = () => {
1525
- var m;
1526
- const b = ((m = a.value) == null ? void 0 : m.bottom) || 0;
1527
- V.position.set(0, b + n.value / 2 + 7e-3, 0);
1616
+ _ && (b.remove(_), _.geometry.dispose(), _.material.dispose(), _ = null), _ = p(), $(), b.add(_);
1617
+ }, $ = () => {
1618
+ var h;
1619
+ const b = ((h = a.value) == null ? void 0 : h.bottom) || 0;
1620
+ _.position.set(0, b + i.value / 2 + 7e-3, 0);
1528
1621
  };
1529
- return Ne = O(
1530
- () => [n.value, r.value],
1531
- ([b, m], [B, F]) => {
1532
- b === B && m === F || (G(), f());
1622
+ return He = j(
1623
+ () => [i.value, r.value],
1624
+ ([b, h], [B, G]) => {
1625
+ b === B && h === G || (F(), g());
1533
1626
  },
1534
1627
  { flush: "post" }
1535
- ), He = O(
1536
- () => i.value,
1628
+ ), Je = j(
1629
+ () => n.value,
1537
1630
  () => {
1538
- f();
1631
+ g();
1539
1632
  },
1540
1633
  { flush: "post" }
1541
- ), qe = O(
1634
+ ), Ke = j(
1542
1635
  () => o.value,
1543
1636
  (b) => {
1544
- E(b);
1637
+ x(b);
1545
1638
  },
1546
1639
  { flush: "post" }
1547
1640
  ), {
1548
- init: S,
1549
- showHideGrid: y,
1550
- updateGridColors: P,
1641
+ init: y,
1642
+ showHideGrid: v,
1643
+ updateGridColors: R,
1551
1644
  dispose: () => {
1552
- var m, B;
1645
+ var h, B;
1553
1646
  const b = u();
1554
- Ne == null || Ne(), He == null || He(), qe == null || qe(), Ne = null, He = null, qe = null, V && (b.remove(V), (m = V.geometry) == null || m.dispose(), Array.isArray(V.material) ? V.material.forEach((F) => F == null ? void 0 : F.dispose()) : (B = V.material) == null || B.dispose(), V = null);
1647
+ He == null || He(), Je == null || Je(), Ke == null || Ke(), He = null, Je = null, Ke = null, _ && (b.remove(_), (h = _.geometry) == null || h.dispose(), Array.isArray(_.material) ? _.material.forEach((G) => G == null ? void 0 : G.dispose()) : (B = _.material) == null || B.dispose(), _ = null);
1555
1648
  }
1556
1649
  };
1557
- }, no = { class: "three-dimension-tool" }, ro = ["data-id"], io = /* @__PURE__ */ Object.assign({
1650
+ }, co = { class: "three-dimension-tool" }, uo = ["data-id"], po = /* @__PURE__ */ Object.assign({
1558
1651
  name: "ThreeDimensionTool",
1559
1652
  slug: "three-dimension-tool",
1560
1653
  inheritAttrs: !1
@@ -1566,82 +1659,95 @@ const Gt = () => {
1566
1659
  setup(e) {
1567
1660
  const t = e;
1568
1661
  let s = null;
1569
- const i = C(() => Number(t.id)), r = A(), n = ct(), o = fe(), l = me(), { move: a } = $(o), u = pe(null), p = pe(!1);
1570
- let D, w, h;
1571
- const f = rt(), S = Mt(), E = Dt(), { init: y, setEnvironment: T } = we(), { init: P } = at(), { init: G } = Le(), { init: H, updateVisibility: Z } = Pt(), { init: b, updatePosition: m } = it(), { init: B } = Rt(), { init: F } = Gt(), z = () => {
1572
- if (!u.value || p.value) {
1662
+ const n = C(() => Number(t.id)), r = M(), i = pt(), o = he(), c = fe(), { move: a } = N(o), { isFrozen: u } = N(r), p = pe(null), P = pe(!1);
1663
+ let w, m, g;
1664
+ const y = ct(), x = At(), v = Bt(), { init: k, setEnvironment: R } = Ie(), { init: F } = Xe(), { init: $ } = Re(), { init: K, updateVisibility: b } = _t(), { init: h, updatePosition: B } = ut(), { init: G } = jt(), { init: z } = Ot(), U = () => {
1665
+ if (!p.value || P.value) {
1573
1666
  console.warn("Canvas element not found");
1574
1667
  return;
1575
1668
  }
1576
- p.value = !0, h = y(), w = P(u.value), T(w), B(), D = G(), b(), F(), H(), f.init(w), j();
1577
- }, j = () => {
1578
- p.value && (a.value !== s && (s = a.value, a.value ? E.activate() : S.activate()), f.update(), a.value ? (m(), E.syncToStore()) : S.syncToStore(), Z(), w.render(h, D), requestAnimationFrame(j));
1669
+ P.value = !0, g = k(), m = F(p.value), R(m), G(), w = $(), h(), z(), K(), y.init(m), Y();
1579
1670
  }, Y = () => {
1580
- if (u.value) {
1581
- const q = window.innerWidth, g = window.innerHeight;
1582
- r.$patch({ width: q, height: g }), u.value.style.height = g + "px";
1671
+ P.value && (a.value !== s && (s = a.value, a.value ? v.activate() : x.activate()), y.update(), a.value ? (B(), v.syncToStore()) : x.syncToStore(), b(), m.render(g, w), requestAnimationFrame(Y));
1672
+ }, X = () => {
1673
+ if (p.value) {
1674
+ const l = window.innerWidth, f = window.innerHeight;
1675
+ r.$patch({ width: l, height: f }), p.value.style.height = f + "px";
1583
1676
  }
1677
+ }, S = () => {
1678
+ u.value && r.pokeFreeze();
1584
1679
  };
1585
- return jt(() => {
1586
- console.log("onMounted", u.value), z(), window.addEventListener("resize", Y), Y();
1587
- }), O(
1588
- () => l.bounds,
1589
- (q) => {
1590
- q && (E.activate(), o.hasRig || (E.frameToBounds(q), E.syncToStore(), o.markFramed()), S.activate(), n.hasRig || (S.frameToBounds(q), S.syncToStore(), n.markFramed()));
1680
+ return j(u, (l) => {
1681
+ var T;
1682
+ const f = (T = y.get) == null ? void 0 : T.call(y);
1683
+ f && (f.enabled = !l);
1684
+ }), j(
1685
+ () => [i.applyRevision, o.applyRevision],
1686
+ () => {
1687
+ P.value && (v.activate(), B(), x.activate());
1688
+ }
1689
+ ), $t(() => {
1690
+ var l;
1691
+ console.log("onMounted", p.value), U(), window.addEventListener("resize", X), X(), (l = p.value) == null || l.addEventListener("pointerdown", S, !0);
1692
+ }), j(
1693
+ () => c.bounds,
1694
+ (l) => {
1695
+ l && (v.activate(), o.hasRig || (v.frameToBounds(l), v.syncToStore(), o.markFramed()), x.activate(), i.hasRig || (x.frameToBounds(l), x.syncToStore(), i.markFramed()));
1591
1696
  }
1592
- ), O(
1697
+ ), j(
1593
1698
  () => r.subjectLoaded,
1594
- (q) => {
1595
- if (!q) return;
1596
- const g = l.bounds;
1597
- if (!g) return;
1598
- n.hasRig || (f.frameToBounds(g), n.markFramed());
1599
- const c = f.get();
1600
- c.update(), c.saveState();
1699
+ (l) => {
1700
+ if (!l) return;
1701
+ const f = c.bounds;
1702
+ if (!f) return;
1703
+ i.hasRig || (y.frameToBounds(f), i.markFramed());
1704
+ const T = y.get();
1705
+ T.update(), T.saveState();
1601
1706
  }
1602
- ), _t(() => {
1603
- console.debug("ThreeDimensionTool unMounted"), window.removeEventListener("resize", this), p.value = !1, Rt().dispose(), Gt().dispose(), Pt().dispose(), it().dispose(), rt().dispose(), Le().dispose(), we().dispose(), at().dispose();
1604
- }), (q, g) => (nt(), rs("div", no, [
1605
- vt("", !0),
1606
- is("div", {
1707
+ ), Ut(() => {
1708
+ var l;
1709
+ console.debug("ThreeDimensionTool unMounted"), window.removeEventListener("resize", this), (l = p.value) == null || l.removeEventListener("pointerdown", S, !0), P.value = !1, jt().dispose(), Ot().dispose(), _t().dispose(), ut().dispose(), ct().dispose(), Re().dispose(), Ie().dispose(), Xe().dispose();
1710
+ }), (l, f) => (at(), cs("div", co, [
1711
+ wt("", !0),
1712
+ us("div", {
1607
1713
  class: "tres",
1608
1714
  ref_key: "tres",
1609
- ref: u,
1610
- "data-id": i.value
1611
- }, null, 8, ro)
1715
+ ref: p,
1716
+ "data-id": n.value
1717
+ }, null, 8, uo)
1612
1718
  ]));
1613
1719
  }
1614
- }), Ft = /* @__PURE__ */ Object.assign({ "../i18n/en-US/index.js": () => import("./index-CwHAnjEe.js") }), W = (e = "../i18n") => {
1615
- const t = ps(), s = pe({}), i = C(() => t.lang.isoName || "en-US"), r = async () => {
1616
- const n = `${e}/${i.value}/index.js`;
1617
- if (Ft[n])
1720
+ }), Nt = /* @__PURE__ */ Object.assign({ "../i18n/en-US/index.js": () => import("./index-CwHAnjEe.js") }), H = (e = "../i18n") => {
1721
+ const t = bs(), s = pe({}), n = C(() => t.lang.isoName || "en-US"), r = async () => {
1722
+ const i = `${e}/${n.value}/index.js`;
1723
+ if (Nt[i])
1618
1724
  try {
1619
- const o = await Ft[n]();
1725
+ const o = await Nt[i]();
1620
1726
  o.default && Object.assign(s.value, o.default);
1621
1727
  } catch (o) {
1622
- console.error(`Error loading i18n for ${i.value}`, o);
1728
+ console.error(`Error loading i18n for ${n.value}`, o);
1623
1729
  }
1624
1730
  else
1625
- console.error(`Module not found: ${n}`);
1731
+ console.error(`Module not found: ${i}`);
1626
1732
  };
1627
- return O(
1628
- () => i.value,
1733
+ return j(
1734
+ () => n.value,
1629
1735
  () => {
1630
1736
  r();
1631
1737
  },
1632
1738
  { immediate: !0 }
1633
- ), as(() => {
1739
+ ), ds(() => {
1634
1740
  r();
1635
1741
  }), { lang: s };
1636
- }, oe = ({ tab: e = se, store: t, options: s = [] }) => {
1637
- const i = bs(), r = A(i), n = C({
1742
+ }, Ee = 26, Z = ({ tab: e = oe, store: t, options: s = [] }) => {
1743
+ const n = ws(), r = M(n), i = C({
1638
1744
  get: () => r.isExpanded(s),
1639
1745
  set: (a) => {
1640
1746
  a && r.setActive(e);
1641
1747
  }
1642
1748
  }), o = C(() => t && t.changed);
1643
- return { click: () => r.setActive(e), expanded: n, selected: o };
1644
- }, Tt = R({
1749
+ return { click: () => r.setActive(e), expanded: i, selected: o };
1750
+ }, zt = V({
1645
1751
  name: "ToolResetButton",
1646
1752
  props: {
1647
1753
  label: { type: String, required: !1, default: "Reset" },
@@ -1649,33 +1755,45 @@ const Gt = () => {
1649
1755
  },
1650
1756
  emits: ["click"],
1651
1757
  setup(e, { slots: t, emit: s }) {
1652
- function i() {
1758
+ function n() {
1653
1759
  s("click");
1654
1760
  }
1655
1761
  function r() {
1656
- const n = {
1762
+ const i = {
1657
1763
  label: e.label,
1658
1764
  class: "full-width",
1659
1765
  flat: !0,
1660
- onClick: i,
1766
+ onClick: n,
1661
1767
  disable: e.disable
1662
1768
  };
1663
- return d("div", { class: "tool-reset-button q-pa-md" }, d(Ut, n));
1769
+ return d("div", { class: "tool-reset-button q-pa-md" }, d(qt, i));
1664
1770
  }
1665
1771
  return () => r();
1666
1772
  }
1667
- }), Yt = R({
1773
+ }), ft = V({
1774
+ name: "FrozenOverlay",
1775
+ setup() {
1776
+ const e = M(), { isFrozen: t } = N(e);
1777
+ function s() {
1778
+ return ps(d("div", {
1779
+ class: "frozen-overlay",
1780
+ onClick: () => e.pokeFreeze()
1781
+ }, []), [[ms, t.value]]);
1782
+ }
1783
+ return () => s();
1784
+ }
1785
+ }), es = V({
1668
1786
  name: "TdColorsSection",
1669
1787
  setup(e, { slots: t, emit: s }) {
1670
- const { lang: i } = W(), r = A(), n = ut(), o = Ve(), { active: l } = $(r), a = pe(!1), u = pe(!1), p = C(
1788
+ const { lang: n } = H(), r = M(), i = mt(), o = Fe(), { active: c } = N(r), a = pe(!1), u = pe(!1), p = C(
1671
1789
  () => {
1672
1790
  var b;
1673
- return (b = i.value.td) == null ? void 0 : b.components.colors.items.background;
1791
+ return (b = n.value.td) == null ? void 0 : b.components.colors.items.background;
1674
1792
  }
1675
- ), D = C(
1793
+ ), P = C(
1676
1794
  () => {
1677
1795
  var b;
1678
- return (b = i.value.td) == null ? void 0 : b.components.colors.items.ground;
1796
+ return (b = n.value.td) == null ? void 0 : b.components.colors.items.ground;
1679
1797
  }
1680
1798
  ), w = C(() => ({
1681
1799
  key: p.value,
@@ -1683,63 +1801,64 @@ const Gt = () => {
1683
1801
  type: "none",
1684
1802
  icon: "f_scene",
1685
1803
  size: "sm",
1686
- color: n.colorHex,
1804
+ color: i.colorHex,
1687
1805
  onClick: () => a.value = !0
1688
- })), h = C(() => ({
1689
- key: D.value,
1690
- label: D.value,
1806
+ })), m = C(() => ({
1807
+ key: P.value,
1808
+ label: P.value,
1691
1809
  type: "none",
1692
1810
  icon: "f_ground",
1693
1811
  size: "sm",
1694
1812
  color: o.colorHex,
1695
1813
  onClick: () => u.value = !0
1696
- })), f = C({
1814
+ })), g = C({
1697
1815
  get: () => u.value || a.value,
1698
1816
  set: (b) => u.value = a.value = !1
1699
- }), S = C({
1700
- get: () => u.value ? o.colorHex : n.colorHex,
1817
+ }), y = C({
1818
+ get: () => u.value ? o.colorHex : i.colorHex,
1701
1819
  set: (b) => {
1702
1820
  if (u.value) {
1703
1821
  o.setColorHex(b);
1704
1822
  return;
1705
1823
  }
1706
- n.setColorHex(b);
1824
+ i.setColorHex(b);
1707
1825
  }
1708
- }), E = C(() => ({
1826
+ }), x = C(() => ({
1709
1827
  class: "td-colors-tool q-pa-xs row justify-center items-center q-gutter-md",
1710
- style: f.value ? "display: none" : ""
1711
- })), y = C(() => ({
1712
- modelValue: S.value,
1713
- "onUpdate:modelValue": (b) => S.value = b,
1714
- show: f.value,
1715
- "onUpdate:show": (b) => f.value = b,
1716
- label: T.value
1717
- })), T = C(() => u.value ? D.value : p.value), P = () => {
1718
- n.reset(), o.reset();
1719
- }, G = C(() => o.changed || n.changed), H = C(() => ({
1828
+ style: g.value ? "display: none" : ""
1829
+ })), v = C(() => ({
1830
+ modelValue: y.value,
1831
+ "onUpdate:modelValue": (b) => y.value = b,
1832
+ show: g.value,
1833
+ "onUpdate:show": (b) => g.value = b,
1834
+ label: k.value
1835
+ })), k = C(() => u.value ? P.value : p.value), R = () => {
1836
+ i.reset(), o.reset();
1837
+ }, F = C(() => o.changed || i.changed), $ = C(() => ({
1720
1838
  label: "Reset Colors",
1721
- onClick: P,
1722
- style: f.value ? "display: none" : "",
1723
- disable: !G.value
1839
+ onClick: R,
1840
+ style: g.value ? "display: none" : "",
1841
+ disable: !F.value
1724
1842
  }));
1725
- O(l, (b) => {
1726
- b !== se && (f.value = !1);
1843
+ j(c, (b) => {
1844
+ b !== oe && (g.value = !1);
1727
1845
  });
1728
- function Z() {
1846
+ function K() {
1729
1847
  return d("div", {
1730
1848
  class: "full-width"
1731
1849
  }, [
1732
- d("div", E.value, [
1733
- d(Ce, w.value),
1734
- d(Ce, h.value)
1850
+ d(ft),
1851
+ d("div", x.value, [
1852
+ d(me, w.value),
1853
+ d(me, m.value)
1735
1854
  ]),
1736
- d(Tt, H.value),
1737
- d(fs, y.value)
1855
+ d(zt, $.value),
1856
+ d(ys, v.value)
1738
1857
  ]);
1739
1858
  }
1740
- return () => Z();
1859
+ return () => K();
1741
1860
  }
1742
- }), ao = R({
1861
+ }), mo = V({
1743
1862
  name: "TdColorsExpansion",
1744
1863
  props: {
1745
1864
  modelValue: { type: Number, default: 0 },
@@ -1748,13 +1867,13 @@ const Gt = () => {
1748
1867
  },
1749
1868
  emits: ["click", "update:modelValue"],
1750
1869
  setup(e, { slots: t, emit: s }) {
1751
- const { lang: i } = W(), r = It(), { expanded: n, selected: o } = oe({
1870
+ const { lang: n } = H(), r = Mt(), { expanded: i, selected: o } = Z({
1752
1871
  store: r,
1753
- options: se,
1754
- tab: se
1755
- }), l = C(() => {
1872
+ options: oe,
1873
+ tab: oe
1874
+ }), c = C(() => {
1756
1875
  var u;
1757
- return (u = i.value.td) == null ? void 0 : u.components.colors.title;
1876
+ return (u = n.value.td) == null ? void 0 : u.components.colors.title;
1758
1877
  });
1759
1878
  C({
1760
1879
  get: () => e.modelValue,
@@ -1764,28 +1883,28 @@ const Gt = () => {
1764
1883
  const u = {
1765
1884
  class: "td-colors-expansion",
1766
1885
  "data-cy": "td-colors-expansion",
1767
- modelValue: n.value,
1768
- "onUpdate:modelValue": (p) => n.value = p,
1769
- label: l.value,
1886
+ modelValue: i.value,
1887
+ "onUpdate:modelValue": (p) => i.value = p,
1888
+ label: c.value,
1770
1889
  selected: o.value,
1771
1890
  icon: "f_palette"
1772
1891
  };
1773
- return d(We, u, () => d(Yt));
1892
+ return d(Ve, u, () => d(es));
1774
1893
  }
1775
1894
  return () => a();
1776
1895
  }
1777
- }), Qt = R({
1896
+ }), ts = V({
1778
1897
  name: "TdGridSection",
1779
1898
  setup(e, { slots: t, emit: s }) {
1780
- const { lang: i } = W(), r = Ee(), n = C(
1899
+ const { lang: n } = H(), r = ke(), i = C(
1781
1900
  () => {
1782
- var w, h;
1783
- return o.value ? ((w = i.value.td) == null ? void 0 : w.components.grid.toggle.off) || "" : ((h = i.value.td) == null ? void 0 : h.components.grid.toggle.on) || "";
1901
+ var w, m;
1902
+ return o.value ? ((w = n.value.td) == null ? void 0 : w.components.grid.toggle.off) || "" : ((m = n.value.td) == null ? void 0 : m.components.grid.toggle.on) || "";
1784
1903
  }
1785
1904
  ), o = C({
1786
1905
  get: () => r.show,
1787
1906
  set: (w) => r.setProperty("show", w)
1788
- }), l = C({
1907
+ }), c = C({
1789
1908
  get: () => r.opacity,
1790
1909
  set: (w) => r.setProperty("opacity", w)
1791
1910
  }), a = C({
@@ -1799,36 +1918,36 @@ const Gt = () => {
1799
1918
  disable: !r.changed,
1800
1919
  onClick: r.reset
1801
1920
  }));
1802
- function D() {
1921
+ function P() {
1803
1922
  const w = {
1804
1923
  class: "td-grid-tool"
1805
- }, h = {
1924
+ }, m = {
1806
1925
  access: "grd",
1807
1926
  // drawer: !props.noIcons,
1808
1927
  modelValue: o.value,
1809
- "onUpdate:modelValue": (T) => o.value = T,
1810
- label: n.value
1928
+ "onUpdate:modelValue": (k) => o.value = k,
1929
+ label: i.value
1811
1930
  // dark: props.dark,
1812
1931
  // disable: props.disable,
1813
1932
  // hasAccess: props.hasAccess,
1814
1933
  // onBlockAccess: emitBlockAccess,
1815
- }, f = {
1934
+ }, g = {
1816
1935
  title: "Opacity",
1817
1936
  icon: "f_opacity",
1818
1937
  min: 1,
1819
1938
  max: 100,
1820
1939
  initial: 50,
1821
- modelValue: l.value * 100,
1822
- "onUpdate:modelValue": (T) => l.value = T / 100
1823
- }, S = {
1940
+ modelValue: c.value * 100,
1941
+ "onUpdate:modelValue": (k) => c.value = k / 100
1942
+ }, y = {
1824
1943
  title: "Size",
1825
1944
  icon: "f_size",
1826
1945
  min: 100,
1827
1946
  max: 300,
1828
1947
  initial: 200,
1829
1948
  modelValue: a.value * 100,
1830
- "onUpdate:modelValue": (T) => a.value = T / 100
1831
- }, E = {
1949
+ "onUpdate:modelValue": (k) => a.value = k / 100
1950
+ }, x = {
1832
1951
  title: "Number of lines",
1833
1952
  icon: "f_grid",
1834
1953
  min: 2,
@@ -1837,13 +1956,13 @@ const Gt = () => {
1837
1956
  step: 2,
1838
1957
  initial: 6,
1839
1958
  modelValue: u.value,
1840
- "onUpdate:modelValue": (T) => u.value = T
1841
- }, y = [d(Ot, h)];
1842
- return o.value && (y.push(d(Ke, S)), y.push(d(Ke, E)), y.push(d(Ke, f)), y.push(d(Tt, p.value))), d("div", w, y);
1959
+ "onUpdate:modelValue": (k) => u.value = k
1960
+ }, v = [d(ft), d(Ht, m)];
1961
+ return o.value && (v.push(d(We, y)), v.push(d(We, x)), v.push(d(We, g)), v.push(d(zt, p.value))), d("div", w, v);
1843
1962
  }
1844
- return () => D();
1963
+ return () => P();
1845
1964
  }
1846
- }), lo = R({
1965
+ }), fo = V({
1847
1966
  name: "TdGridExpansion",
1848
1967
  props: {
1849
1968
  modelValue: { type: Number, default: 0 },
@@ -1852,13 +1971,13 @@ const Gt = () => {
1852
1971
  },
1853
1972
  emits: ["click", "update:modelValue"],
1854
1973
  setup(e, { slots: t, emit: s }) {
1855
- const { lang: i } = W(), r = Ee(), { expanded: n, selected: o } = oe({
1974
+ const { lang: n } = H(), r = ke(), { expanded: i, selected: o } = Z({
1856
1975
  store: r,
1857
- options: Se,
1858
- tab: Se
1859
- }), l = C(() => {
1976
+ options: we,
1977
+ tab: we
1978
+ }), c = C(() => {
1860
1979
  var u;
1861
- return (u = i.value.td) == null ? void 0 : u.components.grid.title;
1980
+ return (u = n.value.td) == null ? void 0 : u.components.grid.title;
1862
1981
  });
1863
1982
  C({
1864
1983
  get: () => e.modelValue,
@@ -1868,17 +1987,17 @@ const Gt = () => {
1868
1987
  const u = {
1869
1988
  class: "td-colors-expansion",
1870
1989
  "data-cy": "td-colors-expansion",
1871
- modelValue: n.value,
1872
- "onUpdate:modelValue": (p) => n.value = p,
1873
- label: l.value,
1990
+ modelValue: i.value,
1991
+ "onUpdate:modelValue": (p) => i.value = p,
1992
+ label: c.value,
1874
1993
  selected: o.value,
1875
1994
  icon: "f_grid"
1876
1995
  };
1877
- return d(We, u, () => d(Qt));
1996
+ return d(Ve, u, () => d(ts));
1878
1997
  }
1879
1998
  return () => a();
1880
1999
  }
1881
- }), Jt = R({
2000
+ }), ss = V({
1882
2001
  name: "TdLightsSection",
1883
2002
  props: {
1884
2003
  modelValue: { type: Number, default: 0 },
@@ -1887,89 +2006,90 @@ const Gt = () => {
1887
2006
  },
1888
2007
  emits: ["click", "update:modelValue"],
1889
2008
  setup() {
1890
- const { lang: e } = W(), t = fe(), s = A(), i = me(), r = it(), n = Dt(), o = Mt(), { active: l } = $(s), a = C({
2009
+ const { lang: e } = H(), t = he(), s = M(), n = fe(), r = ut(), i = Bt(), o = At(), { active: c } = N(s), a = C({
1891
2010
  get: () => t.move,
1892
- set: (m) => t.setMove(m)
2011
+ set: (h) => t.setMove(h)
1893
2012
  }), u = C(
1894
2013
  () => {
1895
- var m, B;
1896
- return t.move ? ((m = e.value.td) == null ? void 0 : m.components.lights.toggles.position.off) || "" : ((B = e.value.td) == null ? void 0 : B.components.lights.toggles.position.on) || "";
2014
+ var h, B;
2015
+ return t.move ? ((h = e.value.td) == null ? void 0 : h.components.lights.toggles.position.off) || "" : ((B = e.value.td) == null ? void 0 : B.components.lights.toggles.position.on) || "";
1897
2016
  }
1898
2017
  ), p = C(() => ({
1899
2018
  modelValue: a.value,
1900
- "onUpdate:modelValue": (m) => a.value = m,
2019
+ "onUpdate:modelValue": (h) => a.value = h,
1901
2020
  label: u.value
1902
- })), D = C(
2021
+ })), P = C(
1903
2022
  () => {
1904
- var m;
1905
- return ((m = e.value.td) == null ? void 0 : m.components.lights.ambientIntensity) || "";
2023
+ var h;
2024
+ return ((h = e.value.td) == null ? void 0 : h.components.lights.ambientIntensity) || "";
1906
2025
  }
1907
2026
  ), w = C(
1908
2027
  () => {
1909
- var m;
1910
- return ((m = e.value.td) == null ? void 0 : m.components.lights.userIntensity) || "";
2028
+ var h;
2029
+ return ((h = e.value.td) == null ? void 0 : h.components.lights.userIntensity) || "";
1911
2030
  }
1912
- ), h = 0, f = 50, S = 100, E = (m, B, F) => ({
1913
- toSlider: (z) => z <= B ? h + (z - m) / (B - m) * (f - h) : f + (z - B) / (F - B) * (S - f),
1914
- fromSlider: (z) => z <= f ? m + (z - h) / (f - h) * (B - m) : B + (z - f) / (S - f) * (F - B)
1915
- }), y = E(
1916
- Be,
1917
- te,
1918
- yt
1919
- ), T = E(
1920
- Be,
1921
- te,
1922
- St
1923
- ), P = (m, B, F, z) => ({
1924
- title: m,
2031
+ ), m = 0, g = 50, y = 100, x = (h, B, G) => ({
2032
+ toSlider: (z) => z <= B ? m + (z - h) / (B - h) * (g - m) : g + (z - B) / (G - B) * (y - g),
2033
+ fromSlider: (z) => z <= g ? h + (z - m) / (g - m) * (B - h) : B + (z - g) / (y - g) * (G - B)
2034
+ }), v = x(
2035
+ Pe,
2036
+ se,
2037
+ Et
2038
+ ), k = x(
2039
+ Pe,
2040
+ se,
2041
+ It
2042
+ ), R = (h, B, G, z) => ({
2043
+ title: h,
1925
2044
  icon: "f_brightness",
1926
- min: h,
1927
- max: S,
1928
- modelValue: B.toSlider(F),
1929
- "onUpdate:modelValue": (j) => {
1930
- z(B.fromSlider(j));
2045
+ min: m,
2046
+ max: y,
2047
+ modelValue: B.toSlider(G),
2048
+ "onUpdate:modelValue": (U) => {
2049
+ z(B.fromSlider(U));
1931
2050
  }
1932
- }), G = C(
1933
- () => P(
1934
- D.value,
1935
- y,
2051
+ }), F = C(
2052
+ () => R(
2053
+ P.value,
2054
+ v,
1936
2055
  t.ambientScale,
1937
- (m) => t.setAmbientScale(m)
2056
+ (h) => t.setAmbientScale(h)
1938
2057
  )
1939
- ), H = C(
1940
- () => P(
2058
+ ), $ = C(
2059
+ () => R(
1941
2060
  w.value,
1942
- T,
2061
+ k,
1943
2062
  t.userScale,
1944
- (m) => t.setUserScale(m)
2063
+ (h) => t.setUserScale(h)
1945
2064
  )
1946
- ), Z = C(() => ({
2065
+ ), K = C(() => ({
1947
2066
  label: "Reset Lights",
1948
2067
  disable: !t.changed,
1949
2068
  onClick: () => {
1950
2069
  var B;
1951
2070
  t.reset();
1952
- const m = i.bounds;
1953
- m && (n.activate(), n.frameToBounds(m), n.syncToStore(), o.activate()), (B = r.applyFromStore) == null || B.call(r);
2071
+ const h = n.bounds;
2072
+ h && (i.activate(), i.frameToBounds(h), i.syncToStore(), o.activate()), (B = r.applyFromStore) == null || B.call(r);
1954
2073
  }
1955
2074
  }));
1956
- O(l, (m) => {
1957
- m !== de && (a.value = !1);
2075
+ j(c, (h) => {
2076
+ h !== de && (a.value = !1);
1958
2077
  });
1959
2078
  function b() {
1960
- const m = {
2079
+ const h = {
1961
2080
  class: "td-lights-tool"
1962
2081
  }, B = [
1963
- d(Ot, p.value),
1964
- d(Ke, G.value),
1965
- d(Ke, H.value),
1966
- d(Tt, Z.value)
2082
+ d(ft),
2083
+ d(Ht, p.value),
2084
+ d(We, F.value),
2085
+ d(We, $.value),
2086
+ d(zt, K.value)
1967
2087
  ];
1968
- return d("div", m, B);
2088
+ return d("div", h, B);
1969
2089
  }
1970
2090
  return () => b();
1971
2091
  }
1972
- }), co = R({
2092
+ }), ho = V({
1973
2093
  name: "TdLightExpansion",
1974
2094
  props: {
1975
2095
  modelValue: { type: Number, default: 0 },
@@ -1978,13 +2098,13 @@ const Gt = () => {
1978
2098
  },
1979
2099
  emits: ["click", "update:modelValue"],
1980
2100
  setup(e, { slots: t, emit: s }) {
1981
- const { lang: i } = W(), r = fe(), { expanded: n, selected: o } = oe({
2101
+ const { lang: n } = H(), r = he(), { expanded: i, selected: o } = Z({
1982
2102
  store: r,
1983
2103
  options: de,
1984
2104
  tab: de
1985
- }), l = C(() => {
2105
+ }), c = C(() => {
1986
2106
  var u;
1987
- return (u = i.value.td) == null ? void 0 : u.components.lights.title;
2107
+ return (u = n.value.td) == null ? void 0 : u.components.lights.title;
1988
2108
  });
1989
2109
  C({
1990
2110
  get: () => e.modelValue,
@@ -1994,75 +2114,105 @@ const Gt = () => {
1994
2114
  const u = {
1995
2115
  class: "td-lights-expansion",
1996
2116
  "data-cy": "td-lights-expansion",
1997
- modelValue: n.value,
1998
- "onUpdate:modelValue": (p) => n.value = p,
1999
- label: l.value,
2117
+ modelValue: i.value,
2118
+ "onUpdate:modelValue": (p) => i.value = p,
2119
+ label: c.value,
2000
2120
  selected: o.value,
2001
2121
  icon: "f_bulb_light"
2002
2122
  };
2003
- return d(We, u, () => d(Jt));
2123
+ return d(Ve, u, () => d(ss));
2004
2124
  }
2005
2125
  return () => a();
2006
2126
  }
2007
- }), es = R({
2127
+ }), os = V({
2008
2128
  name: "TdRelatedSection",
2009
2129
  setup() {
2010
- const e = Symbol.for("RelatedSection"), t = xt(e);
2130
+ const e = Symbol.for("RelatedSection"), t = Ze(e);
2011
2131
  function s() {
2012
- const i = {
2132
+ const n = {
2013
2133
  class: "td-related-section q-mx-lg q-my-sm"
2014
2134
  }, r = [];
2015
- return t && r.push(d(t)), d("div", i, r);
2135
+ return t && r.push(d(t)), d("div", n, r);
2016
2136
  }
2017
2137
  return () => s();
2018
2138
  }
2019
- }), uo = R({
2139
+ }), go = V({
2020
2140
  name: "TdRelatedExpansion",
2021
2141
  setup(e, { slots: t, emit: s }) {
2022
- const { expanded: i } = oe({
2023
- options: xe,
2024
- tab: xe
2142
+ const { expanded: n } = Z({
2143
+ options: Ce,
2144
+ tab: Ce
2025
2145
  }), r = C(() => "Related");
2026
- function n() {
2146
+ function i() {
2027
2147
  const o = {
2028
2148
  class: "td-related-expansion",
2029
- modelValue: i.value,
2030
- "onUpdate:modelValue": (l) => i.value = l,
2149
+ modelValue: n.value,
2150
+ "onUpdate:modelValue": (c) => n.value = c,
2031
2151
  label: r.value,
2032
2152
  icon: "f_related"
2033
2153
  };
2034
- return d(We, o, () => d(es));
2154
+ return d(Ve, o, () => d(os));
2035
2155
  }
2036
- return () => n();
2156
+ return () => i();
2157
+ }
2158
+ }), ns = V({
2159
+ name: "TdSavedSection",
2160
+ setup() {
2161
+ const e = Symbol.for("SavedSection"), t = Ze(e);
2162
+ function s() {
2163
+ return t ? d("div", {
2164
+ class: "td-saved-section q-mx-lg q-my-sm"
2165
+ }, [d(t)]) : null;
2166
+ }
2167
+ return () => s();
2168
+ }
2169
+ }), vo = V({
2170
+ name: "TdSavedExpansion",
2171
+ setup() {
2172
+ const { expanded: e } = Z({
2173
+ options: Ee,
2174
+ tab: Ee
2175
+ }), t = C(() => "Saved");
2176
+ function s() {
2177
+ const n = {
2178
+ class: "td-saved-expansion",
2179
+ modelValue: e.value,
2180
+ "onUpdate:modelValue": (r) => e.value = r,
2181
+ label: t.value,
2182
+ icon: "f_save"
2183
+ };
2184
+ return d(Ve, n, () => d(ns));
2185
+ }
2186
+ return () => s();
2037
2187
  }
2038
2188
  });
2039
- function po() {
2040
- const { freeServer: e, paidServer: t } = vs();
2041
- return ys({ freeServer: e, paidServer: t });
2189
+ function bo() {
2190
+ const { freeServer: e, paidServer: t } = Cs();
2191
+ return Es({ freeServer: e, paidServer: t });
2042
2192
  }
2043
- const mo = Symbol.for("activity-tracking"), fo = ["nude", "muscle", "smooth"];
2044
- function ho() {
2045
- const e = A(), t = me(), s = xt(mo, null), { getThumbnail: i } = po();
2193
+ const yo = Symbol.for("activity-tracking"), So = ["nude", "muscle", "smooth"];
2194
+ function xo() {
2195
+ const e = M(), t = fe(), s = Ze(yo, null), { getThumbnail: n } = bo();
2046
2196
  return { skins: C(() => {
2047
- const n = e.setUuid, o = e.selected, l = {};
2197
+ const i = e.setUuid, o = e.selected, c = {};
2048
2198
  return Object.values(t.models).forEach((a) => {
2049
- !(a != null && a.slug) || l[a.slug] || (l[a.slug] = a);
2050
- }), fo.filter((a) => l[a]).map((a) => {
2051
- const u = l[a];
2199
+ !(a != null && a.slug) || c[a.slug] || (c[a.slug] = a);
2200
+ }), So.filter((a) => c[a]).map((a) => {
2201
+ const u = c[a];
2052
2202
  return {
2053
2203
  id: u.id,
2054
2204
  slug: a,
2055
2205
  name: a,
2056
- imageUrl: n ? i({ type: "sets", uuid: n, image: a }) : null,
2206
+ imageUrl: i ? n({ type: "sets", uuid: i, image: a }) : null,
2057
2207
  selected: u.id === o,
2058
2208
  click: () => {
2059
- e.selected = u.id, s == null || s.trackEvent(Ts, { value: a });
2209
+ e.selected = u.id, s == null || s.trackEvent(Ps, { value: a });
2060
2210
  }
2061
2211
  };
2062
2212
  });
2063
2213
  }) };
2064
2214
  }
2065
- const go = R({
2215
+ const wo = V({
2066
2216
  name: "TdSkinButton",
2067
2217
  props: {
2068
2218
  id: { type: Number, required: !0 },
@@ -2078,7 +2228,7 @@ const go = R({
2078
2228
  margin: "3px",
2079
2229
  marginBottom: e.size === "sm" ? "40px" : "30px"
2080
2230
  }));
2081
- function i() {
2231
+ function n() {
2082
2232
  const r = {
2083
2233
  class: `td-${e.slug}-button td-skin-button`,
2084
2234
  key: e.id,
@@ -2091,63 +2241,63 @@ const go = R({
2091
2241
  selected: e.selected,
2092
2242
  onClick: () => t("click")
2093
2243
  };
2094
- return d(Ce, r);
2244
+ return d(me, r);
2095
2245
  }
2096
- return () => i();
2246
+ return () => n();
2097
2247
  }
2098
- }), ts = R({
2248
+ }), rs = V({
2099
2249
  name: "TdSkinsSection",
2100
2250
  props: { size: { type: String, default: "sm" } },
2101
2251
  setup(e) {
2102
- const { skins: t } = ho(), { lang: s } = W();
2103
- function i() {
2104
- const r = t.value.map(
2105
- (n) => {
2106
- var o, l;
2107
- return d(go, {
2108
- id: n.id,
2109
- slug: n.slug,
2110
- label: ((l = (o = s.value.td) == null ? void 0 : o.components.skins.items) == null ? void 0 : l[n.slug]) ?? n.slug,
2111
- image: n.imageUrl,
2112
- selected: n.selected,
2252
+ const { skins: t } = xo(), { lang: s } = H();
2253
+ function n() {
2254
+ const r = [d(ft)];
2255
+ return t.value.forEach((i) => {
2256
+ var o, c;
2257
+ r.push(
2258
+ d(wo, {
2259
+ id: i.id,
2260
+ slug: i.slug,
2261
+ label: ((c = (o = s.value.td) == null ? void 0 : o.components.skins.items) == null ? void 0 : c[i.slug]) ?? i.slug,
2262
+ image: i.imageUrl,
2263
+ selected: i.selected,
2113
2264
  size: e.size,
2114
- onClick: n.click
2115
- });
2116
- }
2117
- );
2118
- return d($t, {}, () => r);
2265
+ onClick: i.click
2266
+ })
2267
+ );
2268
+ }), d(Jt, {}, () => r);
2119
2269
  }
2120
- return () => i();
2270
+ return () => n();
2121
2271
  }
2122
- }), bo = R({
2272
+ }), Co = V({
2123
2273
  name: "TdSkinsExpansion",
2124
2274
  setup() {
2125
- const { lang: e } = W(), t = me(), { expanded: s } = oe({
2126
- options: ye,
2127
- tab: ye
2128
- }), i = C(() => {
2129
- var l;
2130
- const o = (l = t.model) == null ? void 0 : l.slug;
2131
- return !!o && o !== qt;
2275
+ const { lang: e } = H(), t = fe(), { expanded: s } = Z({
2276
+ options: xe,
2277
+ tab: xe
2278
+ }), n = C(() => {
2279
+ var c;
2280
+ const o = (c = t.model) == null ? void 0 : c.slug;
2281
+ return !!o && o !== Wt;
2132
2282
  }), r = C(() => {
2133
2283
  var o;
2134
2284
  return (o = e.value.td) == null ? void 0 : o.components.skins.title;
2135
2285
  });
2136
- function n() {
2286
+ function i() {
2137
2287
  const o = {
2138
2288
  class: "td-skins-expansion",
2139
2289
  "data-cy": "td-skins-expansion",
2140
2290
  modelValue: s.value,
2141
- "onUpdate:modelValue": (l) => s.value = l,
2291
+ "onUpdate:modelValue": (c) => s.value = c,
2142
2292
  label: r.value,
2143
- selected: i.value,
2293
+ selected: n.value,
2144
2294
  icon: "f_shirt"
2145
2295
  };
2146
- return d(We, o, () => d(ts, { size: "sm", class: "q-py-sm" }));
2296
+ return d(Ve, o, () => d(rs, { size: "sm", class: "q-py-sm" }));
2147
2297
  }
2148
- return () => n();
2298
+ return () => i();
2149
2299
  }
2150
- }), ss = R({
2300
+ }), Eo = V({
2151
2301
  name: "TdButtons",
2152
2302
  props: {
2153
2303
  modelValue: { type: Number, default: 0 },
@@ -2160,131 +2310,145 @@ const go = R({
2160
2310
  },
2161
2311
  emits: ["click", "update:modelValue"],
2162
2312
  setup(e, { slots: t, emit: s }) {
2163
- const i = Mt(), r = Dt(), n = ct(), o = Ve(), l = fe(), a = ut(), { changed: u } = $(n), { changed: p } = $(o), { changed: D } = $(l), { changed: w } = $(a), h = C(() => !(u.value || p.value || D.value || w.value));
2164
- function f() {
2165
- n.reset(), o.reset(), l.reset(), a.reset(), i.applyFromStore(), r.applyFromStore();
2313
+ const n = At(), r = Bt(), i = pt(), o = Fe(), c = he(), a = mt(), { changed: u } = N(i), { changed: p } = N(o), { changed: P } = N(c), { changed: w } = N(a), m = C(() => !(u.value || p.value || P.value || w.value));
2314
+ function g() {
2315
+ i.reset(), o.reset(), c.reset(), a.reset(), n.applyFromStore(), r.applyFromStore();
2166
2316
  }
2167
- const S = (y) => y.preventDefault();
2168
- function E() {
2169
- const T = {
2317
+ const y = (v) => v.preventDefault();
2318
+ function x() {
2319
+ const k = {
2170
2320
  style: C(() => e.fixed ? "position: fixed;bottom: 0; left: 0; right: 0;border-top: 1px solid var(--grey-300)" : ""),
2171
2321
  class: "row justify-center items-center q-pa-md"
2172
- }, P = {
2322
+ }, R = {
2173
2323
  class: "td-reset-button",
2174
2324
  label: "Reset All",
2175
- onClick: f,
2176
- onKeyup: S,
2325
+ onClick: g,
2326
+ onKeyup: y,
2177
2327
  rounded: !0,
2178
2328
  unelevated: !0,
2179
2329
  outline: !0,
2180
- disable: h.value
2330
+ disable: m.value
2181
2331
  };
2182
- return d("div", T, [d(Ut, P)]);
2332
+ return d("div", k, [d(qt, R)]);
2183
2333
  }
2184
- return () => E();
2334
+ return () => x();
2185
2335
  }
2186
- }), vo = R({
2336
+ }), is = V({
2337
+ name: "TdPoseButtonsSection",
2338
+ setup() {
2339
+ const e = Symbol.for("PoseButtonsSection"), t = Ze(e, null);
2340
+ function s() {
2341
+ const n = {
2342
+ class: "td-pose-buttons-section"
2343
+ }, r = [];
2344
+ return t && r.push(d(t)), d("div", n, r);
2345
+ }
2346
+ return () => s();
2347
+ }
2348
+ }), Io = V({
2187
2349
  name: "TdExpansions",
2188
2350
  setup(e, { slots: t, emit: s }) {
2189
- function i() {
2351
+ function n() {
2190
2352
  return d("div", {
2191
2353
  class: "td-expansions",
2192
- onClick: (n) => n.stopPropagation(),
2354
+ onClick: (i) => i.stopPropagation(),
2193
2355
  style: "padding-bottom: 60px; position: relative "
2194
2356
  }, [
2195
- // h(TsPoseButtonsSection),
2196
- d(Ie),
2197
- d(bo),
2198
- d(Ie),
2199
- d(ao),
2200
- d(Ie),
2201
- d(lo),
2202
- d(Ie),
2203
- d(co),
2204
- d(Ie),
2357
+ d(is),
2358
+ d(ve),
2359
+ d(Co),
2360
+ d(ve),
2361
+ d(mo),
2362
+ d(ve),
2363
+ d(fo),
2364
+ d(ve),
2365
+ d(ho),
2366
+ d(ve),
2205
2367
  // h(TsGridExpansion),
2206
2368
  // h(QSeparator),
2207
2369
  // h(TsAdjustmentExpansion),
2208
- d(uo),
2209
- d(Ie),
2370
+ d(go),
2371
+ d(ve),
2372
+ d(vo),
2373
+ d(ve),
2210
2374
  // h('div', {}, store.loading.percent),
2211
- d(ss)
2375
+ d(Eo)
2212
2376
  ]);
2213
2377
  }
2214
- return () => i();
2378
+ return () => n();
2215
2379
  }
2216
- }), yo = R({
2380
+ }), Do = V({
2217
2381
  name: "TdColorsButton",
2218
2382
  props: { size: String },
2219
2383
  setup(e, {}) {
2220
- const t = Ee(), s = A(), i = C(() => (s == null ? void 0 : s.hasAccess("grd")) || !1), { lang: r } = W(), n = C(() => {
2384
+ const t = ke(), s = M(), n = C(() => (s == null ? void 0 : s.hasAccess("grd")) || !1), { lang: r } = H(), i = C(() => {
2221
2385
  var p;
2222
2386
  return (p = r.value.td) == null ? void 0 : p.controls.colors.iconTitle;
2223
- }), { click: o, selected: l } = oe({
2387
+ }), { click: o, selected: c } = Z({
2224
2388
  store: t,
2225
- options: se,
2226
- tab: se
2389
+ options: oe,
2390
+ tab: oe
2227
2391
  });
2228
2392
  function a(p) {
2229
2393
  return s.block(p);
2230
2394
  }
2231
2395
  function u() {
2232
2396
  const p = {
2233
- hasAccess: i.value,
2234
- selected: l.value,
2397
+ hasAccess: n.value,
2398
+ selected: c.value,
2235
2399
  onClick: o,
2236
2400
  onBlockAccess: a,
2237
2401
  size: e.size,
2238
- "data-id": se,
2402
+ "data-id": oe,
2239
2403
  name: "colors",
2240
2404
  type: "none",
2241
2405
  icon: "f_palette",
2242
- label: n.value
2406
+ label: i.value
2243
2407
  };
2244
- return d(Ce, p, () => []);
2408
+ return d(me, p, () => []);
2245
2409
  }
2246
2410
  return () => u();
2247
2411
  }
2248
- }), So = R({
2412
+ }), ko = V({
2249
2413
  name: "TdGridButton",
2250
2414
  props: { size: String },
2251
2415
  setup(e, {}) {
2252
- const t = Ee(), s = A(), i = C(() => (s == null ? void 0 : s.hasAccess("grd")) || !1), { lang: r } = W(), n = C(() => {
2416
+ const t = ke(), s = M(), n = C(() => (s == null ? void 0 : s.hasAccess("grd")) || !1), { lang: r } = H(), i = C(() => {
2253
2417
  var p;
2254
2418
  return (p = r.value.td) == null ? void 0 : p.controls.grid.iconTitle;
2255
- }), { click: o, selected: l } = oe({
2419
+ }), { click: o, selected: c } = Z({
2256
2420
  store: t,
2257
- options: Se,
2258
- tab: Se
2421
+ options: we,
2422
+ tab: we
2259
2423
  });
2260
2424
  function a(p) {
2261
2425
  return s.block(p);
2262
2426
  }
2263
2427
  function u() {
2264
2428
  const p = {
2265
- hasAccess: i.value,
2266
- selected: l.value,
2429
+ hasAccess: n.value,
2430
+ selected: c.value,
2267
2431
  onClick: o,
2268
2432
  onBlockAccess: a,
2269
2433
  size: e.size,
2270
- "data-id": Se,
2434
+ "data-id": we,
2271
2435
  name: "grid",
2272
2436
  type: "none",
2273
2437
  icon: "f_grid",
2274
- label: n.value
2438
+ label: i.value
2275
2439
  };
2276
- return d(Ce, p, () => []);
2440
+ return d(me, p, () => []);
2277
2441
  }
2278
2442
  return () => u();
2279
2443
  }
2280
- }), xo = R({
2444
+ }), To = V({
2281
2445
  name: "TdLightsButton",
2282
2446
  props: { size: String },
2283
2447
  setup(e, {}) {
2284
- const t = Ee(), s = A(), i = C(() => (s == null ? void 0 : s.hasAccess("grd")) || !1), { lang: r } = W(), n = C(() => {
2448
+ const t = ke(), s = M(), n = C(() => (s == null ? void 0 : s.hasAccess("grd")) || !1), { lang: r } = H(), i = C(() => {
2285
2449
  var p;
2286
2450
  return (p = r.value.td) == null ? void 0 : p.controls.lights.iconTitle;
2287
- }), { click: o, selected: l } = oe({
2451
+ }), { click: o, selected: c } = Z({
2288
2452
  store: t,
2289
2453
  options: de,
2290
2454
  tab: de
@@ -2294,8 +2458,8 @@ const go = R({
2294
2458
  }
2295
2459
  function u() {
2296
2460
  const p = {
2297
- hasAccess: i.value,
2298
- selected: l.value,
2461
+ hasAccess: n.value,
2462
+ selected: c.value,
2299
2463
  onClick: o,
2300
2464
  onBlockAccess: a,
2301
2465
  size: e.size,
@@ -2303,190 +2467,242 @@ const go = R({
2303
2467
  name: "lights",
2304
2468
  type: "none",
2305
2469
  icon: "f_bulb_light",
2306
- label: n.value
2470
+ label: i.value
2307
2471
  };
2308
- return d(Ce, p, () => []);
2472
+ return d(me, p, () => []);
2309
2473
  }
2310
2474
  return () => u();
2311
2475
  }
2312
- }), Co = R({
2476
+ }), Mo = V({
2313
2477
  name: "TsAdjustmentsButton",
2314
2478
  props: { size: String },
2315
2479
  setup(e, {}) {
2316
- const t = A(), { lang: s } = W(), i = C(() => {
2480
+ const t = M(), { lang: s } = H(), n = C(() => {
2317
2481
  var a;
2318
2482
  return (a = s.value.td) == null ? void 0 : a.controls.related.iconTitle;
2319
- }), { click: r, selected: n } = oe({
2320
- options: xe,
2321
- tab: xe
2483
+ }), { click: r, selected: i } = Z({
2484
+ options: Ce,
2485
+ tab: Ce
2322
2486
  });
2323
2487
  function o(a) {
2324
2488
  return t.block(a);
2325
2489
  }
2326
- function l() {
2490
+ function c() {
2327
2491
  const a = {
2328
2492
  hasAccess: !0,
2329
- selected: n.value,
2493
+ selected: i.value,
2330
2494
  onClick: r,
2331
2495
  onBlockAccess: o,
2332
- "data-id": xe,
2496
+ "data-id": Ce,
2333
2497
  size: e.size,
2334
2498
  name: "related",
2335
2499
  icon: "f_related",
2336
2500
  type: "none",
2337
- label: i.value
2501
+ label: n.value
2338
2502
  };
2339
- return d(Ce, a, () => []);
2503
+ return d(me, a, () => []);
2340
2504
  }
2341
- return () => l();
2505
+ return () => c();
2342
2506
  }
2343
- }), wo = R({
2344
- name: "TsDefaultDrawer",
2507
+ }), Ao = V({
2508
+ name: "TdSavedButton",
2509
+ props: { size: String },
2510
+ setup(e) {
2511
+ const t = M(), { lang: s } = H(), n = C(
2512
+ () => {
2513
+ var a, u;
2514
+ return ((u = (a = s.value.td) == null ? void 0 : a.controls.saved) == null ? void 0 : u.iconTitle) || "Saved";
2515
+ }
2516
+ ), { click: r, selected: i } = Z({
2517
+ options: Ee,
2518
+ tab: Ee
2519
+ });
2520
+ function o(a) {
2521
+ return t.block(a);
2522
+ }
2523
+ function c() {
2524
+ const a = {
2525
+ hasAccess: !0,
2526
+ selected: i.value,
2527
+ onClick: r,
2528
+ onBlockAccess: o,
2529
+ "data-id": Ee,
2530
+ size: e.size,
2531
+ name: "saved",
2532
+ icon: "f_save",
2533
+ type: "none",
2534
+ label: n.value
2535
+ };
2536
+ return d(me, a, () => []);
2537
+ }
2538
+ return () => c();
2539
+ }
2540
+ }), Bo = V({
2541
+ name: "TdDefaultDrawer",
2345
2542
  props: {},
2346
2543
  emits: ["click"],
2347
- setup(e, { slots: t, emit: s }) {
2348
- const i = A(), r = "q-ma-xs";
2349
- function n(o) {
2544
+ setup() {
2545
+ const e = M(), t = "q-ma-xs";
2546
+ function s(n) {
2350
2547
  return {
2351
- class: r,
2548
+ class: t,
2352
2549
  size: "sm",
2353
- onClick: () => i.setActive(o)
2550
+ onClick: () => e.setActive(n)
2354
2551
  };
2355
2552
  }
2356
2553
  return () => d(
2357
- Pe,
2358
- { name: Nt },
2554
+ De,
2555
+ { name: lt },
2359
2556
  {
2360
- default: () => d($t, {}, () => [
2361
- d(yo, n(se)),
2362
- d(So, n(Se)),
2363
- d(xo, n(de)),
2364
- d(Co, n(xe))
2557
+ default: () => d(Jt, {}, () => [
2558
+ d(Do, s(oe)),
2559
+ d(ko, s(we)),
2560
+ d(To, s(de)),
2561
+ d(Mo, s(Ce)),
2562
+ d(Ao, s(Ee))
2365
2563
  ]),
2366
- secondary: () => d(ss, { fixed: !1 })
2564
+ secondary: () => d(is)
2367
2565
  }
2368
2566
  );
2369
2567
  }
2370
- }), Eo = R({
2568
+ }), zo = V({
2371
2569
  name: "TdGridDrawer",
2372
2570
  setup(e, { slots: t, emit: s }) {
2373
- const { lang: i } = W(), r = C(() => {
2571
+ const { lang: n } = H(), r = C(() => {
2374
2572
  var o;
2375
- return (o = i.value.td) == null ? void 0 : o.controls.grid.title;
2573
+ return (o = n.value.td) == null ? void 0 : o.controls.grid.title;
2376
2574
  });
2377
- function n() {
2575
+ function i() {
2378
2576
  const o = {
2379
2577
  class: "td-grid-drawer",
2380
- name: Se,
2578
+ name: we,
2381
2579
  label: r.value
2382
2580
  };
2383
- return d(Pe, o, () => d(Qt));
2581
+ return d(De, o, () => d(ts));
2384
2582
  }
2385
- return () => n();
2583
+ return () => i();
2386
2584
  }
2387
- }), Io = R({
2585
+ }), Po = V({
2388
2586
  name: "TdRelatedDrawer",
2389
2587
  setup(e, { slots: t, emit: s }) {
2390
- const { lang: i } = W(), r = C(() => {
2588
+ const { lang: n } = H(), r = C(() => {
2391
2589
  var o;
2392
- return (o = i.value.td) == null ? void 0 : o.controls.related.title;
2590
+ return (o = n.value.td) == null ? void 0 : o.controls.related.title;
2393
2591
  });
2394
- function n() {
2592
+ function i() {
2395
2593
  const o = {
2396
2594
  class: "td-related-drawer",
2397
- name: xe,
2595
+ name: Ce,
2398
2596
  label: r.value
2399
2597
  };
2400
- return d(Pe, o, () => d(es));
2598
+ return d(De, o, () => d(os));
2401
2599
  }
2402
- return () => n();
2600
+ return () => i();
2601
+ }
2602
+ }), Lo = V({
2603
+ name: "TdSavedDrawer",
2604
+ setup() {
2605
+ const { lang: e } = H(), t = C(() => {
2606
+ var n, r;
2607
+ return ((r = (n = e.value.td) == null ? void 0 : n.controls.saved) == null ? void 0 : r.title) || "Saved";
2608
+ });
2609
+ function s() {
2610
+ const n = {
2611
+ class: "td-saved-drawer",
2612
+ name: Ee,
2613
+ label: t.value
2614
+ };
2615
+ return d(De, n, () => d(ns));
2616
+ }
2617
+ return () => s();
2403
2618
  }
2404
- }), Mo = R({
2619
+ }), Ro = V({
2405
2620
  name: "TdLightsDrawer",
2406
2621
  setup(e, { slots: t, emit: s }) {
2407
- const { lang: i } = W(), r = C(() => {
2622
+ const { lang: n } = H(), r = C(() => {
2408
2623
  var o;
2409
- return (o = i.value.td) == null ? void 0 : o.controls.lights.title;
2624
+ return (o = n.value.td) == null ? void 0 : o.controls.lights.title;
2410
2625
  });
2411
- function n() {
2626
+ function i() {
2412
2627
  const o = {
2413
2628
  class: "td-lights-drawer",
2414
2629
  name: de,
2415
2630
  label: r.value
2416
2631
  };
2417
- return d(Pe, o, () => d(Jt));
2632
+ return d(De, o, () => d(ss));
2418
2633
  }
2419
- return () => n();
2634
+ return () => i();
2420
2635
  }
2421
- }), Do = R({
2636
+ }), Vo = V({
2422
2637
  name: "TdLightsDrawer",
2423
2638
  setup(e, { slots: t, emit: s }) {
2424
- const { lang: i } = W(), r = C(() => {
2639
+ const { lang: n } = H(), r = C(() => {
2425
2640
  var o;
2426
- return (o = i.value.td) == null ? void 0 : o.controls.colors.title;
2641
+ return (o = n.value.td) == null ? void 0 : o.controls.colors.title;
2427
2642
  });
2428
- function n() {
2643
+ function i() {
2429
2644
  const o = {
2430
2645
  class: "td-colors-drawer",
2431
- name: se,
2646
+ name: oe,
2432
2647
  label: r.value
2433
2648
  };
2434
- return d(Pe, o, () => d(Yt));
2649
+ return d(De, o, () => d(es));
2435
2650
  }
2436
- return () => n();
2651
+ return () => i();
2437
2652
  }
2438
- }), To = R({
2653
+ }), Fo = V({
2439
2654
  name: "TdSkinsDrawer",
2440
2655
  setup() {
2441
- const { lang: e } = W(), { expanded: t } = oe({
2442
- options: ye,
2443
- tab: ye
2656
+ const { lang: e } = H(), { expanded: t } = Z({
2657
+ options: xe,
2658
+ tab: xe
2444
2659
  }), s = C(() => {
2445
2660
  var r;
2446
2661
  return (r = e.value.td) == null ? void 0 : r.controls.skins.title;
2447
2662
  });
2448
- function i() {
2663
+ function n() {
2449
2664
  const r = {
2450
2665
  class: "td-skins-drawer",
2451
- name: ye,
2666
+ name: xe,
2452
2667
  label: s.value,
2453
2668
  modelValue: t.value,
2454
- "onUpdate:modelValue": (n) => t.value = n
2669
+ "onUpdate:modelValue": (i) => t.value = i
2455
2670
  };
2456
- return d(Pe, r, () => d(ts));
2671
+ return d(De, r, () => d(rs));
2457
2672
  }
2458
- return () => i();
2673
+ return () => n();
2459
2674
  }
2460
- }), ko = R({
2675
+ }), _o = V({
2461
2676
  name: "TsDrawers",
2462
2677
  setup(e, { slots: t, emit: s }) {
2463
- const i = A(), r = C({
2464
- get: () => i.active,
2465
- set: (o) => i.setActive(o)
2678
+ const n = M(), r = C({
2679
+ get: () => n.active,
2680
+ set: (o) => n.setActive(o)
2466
2681
  });
2467
- function n() {
2682
+ function i() {
2468
2683
  const o = {
2469
2684
  modelValue: r.value,
2470
- "onUpdate:modelValue": (l) => r.value = l
2685
+ "onUpdate:modelValue": (c) => r.value = c
2471
2686
  };
2472
- return d(hs, o, () => [
2473
- d(wo),
2474
- d(To),
2475
- d(Mo),
2476
- d(Do),
2477
- d(Eo),
2478
- d(Io)
2687
+ return d(Ss, o, () => [
2688
+ d(Bo),
2689
+ d(Fo),
2690
+ d(Ro),
2691
+ d(Vo),
2692
+ d(zo),
2693
+ d(Po),
2694
+ d(Lo)
2479
2695
  ]);
2480
2696
  }
2481
- return () => n();
2697
+ return () => i();
2482
2698
  }
2483
- }), No = /* @__PURE__ */ Object.assign({
2699
+ }), Qo = /* @__PURE__ */ Object.assign({
2484
2700
  name: "TdPage",
2485
2701
  slug: "td-page",
2486
2702
  inheritAttrs: !1
2487
2703
  }, {
2488
2704
  __name: "TdPage",
2489
- props: /* @__PURE__ */ ds({
2705
+ props: /* @__PURE__ */ vs({
2490
2706
  id: Number
2491
2707
  }, {
2492
2708
  miniState: { type: Boolean },
@@ -2494,41 +2710,41 @@ const go = R({
2494
2710
  }),
2495
2711
  emits: ["update:miniState"],
2496
2712
  setup(e) {
2497
- const t = e, s = Symbol.for("activity-tracking"), i = A(), r = xt(s, null), n = C(() => Number(t.id)), o = ls(e, "miniState"), l = (a) => {
2498
- a && (r == null || r.trackEvent(Ds, {
2499
- glb_id: i.selected || null,
2713
+ const t = e, s = Symbol.for("activity-tracking"), n = M(), r = Ze(s, null), i = C(() => Number(t.id)), o = fs(e, "miniState"), c = (a) => {
2714
+ a && (r == null || r.trackEvent(zs, {
2715
+ glb_id: n.selected || null,
2500
2716
  base_pose_id: a
2501
2717
  }));
2502
2718
  };
2503
- return jt(async () => {
2504
- r && (await r.beginExplore(), r.trackEvent(Ms, { from: null, to: "3d" }), i.basePoseId && (r.beginSegment(String(i.basePoseId)), l(i.basePoseId)));
2505
- }), O(
2506
- () => i.basePoseId,
2719
+ return $t(async () => {
2720
+ r && (await r.beginExplore(), r.trackEvent(Bs, { from: null, to: "3d" }), n.basePoseId && (r.beginSegment(String(n.basePoseId)), c(n.basePoseId)));
2721
+ }), j(
2722
+ () => n.basePoseId,
2507
2723
  (a, u) => {
2508
- !a || a === u || (r == null || r.beginSegment(String(a)), l(a));
2724
+ !a || a === u || (r == null || r.beginSegment(String(a)), c(a));
2509
2725
  }
2510
- ), cs(() => {
2511
- i.setActive(ms.is.mobile ? Nt : se), r == null || r.end();
2512
- }), (a, u) => (nt(), mt(ft(gs), {
2726
+ ), hs(() => {
2727
+ n.setActive(Ct.is.mobile ? lt : oe), r == null || r.end();
2728
+ }), (a, u) => (at(), vt(bt(xs), {
2513
2729
  class: "three-dimension-page",
2514
2730
  miniState: o.value,
2515
2731
  "onUpdate:miniState": u[0] || (u[0] = (p) => o.value = p),
2516
2732
  "no-drawer-padding": !0,
2517
2733
  title: "3D Viewer"
2518
2734
  }, {
2519
- toolDrawer: ht(() => [
2520
- a.$q.platform.is.mobile ? vt("", !0) : (nt(), mt(ft(vo), { key: 0 }))
2735
+ toolDrawer: yt(() => [
2736
+ a.$q.platform.is.mobile ? wt("", !0) : (at(), vt(bt(Io), { key: 0 }))
2521
2737
  ]),
2522
- bottomDrawer: ht(() => [
2523
- a.$q.platform.is.mobile ? (nt(), mt(ft(ko), { key: 0 })) : vt("", !0)
2738
+ bottomDrawer: yt(() => [
2739
+ a.$q.platform.is.mobile ? (at(), vt(bt(_o), { key: 0 })) : wt("", !0)
2524
2740
  ]),
2525
- default: ht(() => [
2526
- us(io, { id: n.value }, null, 8, ["id"])
2741
+ default: yt(() => [
2742
+ gs(po, { id: i.value }, null, 8, ["id"])
2527
2743
  ]),
2528
2744
  _: 1
2529
2745
  }, 8, ["miniState"]));
2530
2746
  }
2531
- }), Ao = [
2747
+ }), Go = [
2532
2748
  "#141111",
2533
2749
  "#3E251E",
2534
2750
  "#633C30",
@@ -2569,28 +2785,28 @@ const go = R({
2569
2785
  "#BDACA8",
2570
2786
  "#DACDC9",
2571
2787
  "#E5E4E3"
2572
- ], Ho = Xe("3d-fbxs", {
2788
+ ], en = Ye("3d-fbxs", {
2573
2789
  state: () => ({
2574
2790
  models: {},
2575
2791
  loadingUrl: null,
2576
- palette: Ao
2792
+ palette: Go
2577
2793
  }),
2578
2794
  getters: {
2579
2795
  changed(e) {
2580
- var i, r, n, o, l;
2581
- const s = A().selected;
2582
- return console.log("fbx model", (i = e.models) == null ? void 0 : i[s]), (n = (r = e.models) == null ? void 0 : r[s]) != null && n.color ? ((l = (o = e.models) == null ? void 0 : o[s]) == null ? void 0 : l.color) !== 16777215 : !1;
2796
+ var n, r, i, o, c;
2797
+ const s = M().selected;
2798
+ return console.log("fbx model", (n = e.models) == null ? void 0 : n[s]), (i = (r = e.models) == null ? void 0 : r[s]) != null && i.color ? ((c = (o = e.models) == null ? void 0 : o[s]) == null ? void 0 : c.color) !== 16777215 : !1;
2583
2799
  },
2584
2800
  selectedId() {
2585
- return A().selected;
2801
+ return M().selected;
2586
2802
  },
2587
2803
  poseId(e) {
2588
- var i, r;
2589
- const s = A().selected;
2590
- return (r = (i = e.models) == null ? void 0 : i[s]) == null ? void 0 : r.poseId;
2804
+ var n, r;
2805
+ const s = M().selected;
2806
+ return (r = (n = e.models) == null ? void 0 : n[s]) == null ? void 0 : r.poseId;
2591
2807
  },
2592
2808
  model(e) {
2593
- const s = A().selected;
2809
+ const s = M().selected;
2594
2810
  return s && e.models[s] ? e.models[s] : null;
2595
2811
  },
2596
2812
  url() {
@@ -2612,32 +2828,32 @@ const go = R({
2612
2828
  },
2613
2829
  actions: {
2614
2830
  resetColor() {
2615
- const t = A().selected;
2831
+ const t = M().selected;
2616
2832
  this.models[t].color = 16777215;
2617
2833
  },
2618
2834
  setBounds(e) {
2619
- const s = A().selected;
2620
- this.models[s].bounds = Ht(e);
2835
+ const s = M().selected;
2836
+ this.models[s].bounds = Kt(e);
2621
2837
  },
2622
2838
  setSubjectsFromResponse(e) {
2623
2839
  const t = e.entities.fbx;
2624
2840
  this.models = { ...this.models, ...t };
2625
2841
  },
2626
2842
  setColorHex(e) {
2627
- const s = A().selected;
2628
- this.models[s].color = Ye(e);
2843
+ const s = M().selected;
2844
+ this.models[s].color = et(e);
2629
2845
  }
2630
2846
  }
2631
2847
  });
2632
2848
  export {
2633
- No as TdPage,
2634
- A as use3dStore,
2635
- It as useColorsStore,
2636
- ct as useControlsStore,
2637
- Ho as useFBXStore,
2638
- me as useGLBStore,
2639
- Ee as useGridStore,
2640
- Ve as useGroundStore,
2641
- fe as useLightsStore,
2642
- ut as useSceneStore
2849
+ Qo as TdPage,
2850
+ M as use3dStore,
2851
+ Mt as useColorsStore,
2852
+ pt as useControlsStore,
2853
+ en as useFBXStore,
2854
+ fe as useGLBStore,
2855
+ ke as useGridStore,
2856
+ Fe as useGroundStore,
2857
+ he as useLightsStore,
2858
+ mt as useSceneStore
2643
2859
  };