@tresjs/leches 0.14.0 → 0.15.0-next.2

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,100 +1,101 @@
1
1
  /**
2
2
  * name: @tresjs/leches
3
- * version: v0.14.0
3
+ * version: v0.15.0-next.2
4
4
  * (c) 2023
5
5
  * description: Tasty GUI for Vue controls 🍰
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
7
7
  */
8
- import { unref as K, isRef as G, toRefs as B, customRef as gt, ref as d, watch as O, computed as z, defineComponent as k, reactive as N, h as mt, provide as yt, isReactive as ht, openBlock as p, createElementBlock as h, normalizeClass as M, Fragment as V, createTextVNode as st, toDisplayString as F, createVNode as X, createElementVNode as f, withDirectives as ct, vShow as it, normalizeStyle as _t, renderList as j, createCommentVNode as H, createBlock as C, Transition as wt, withCtx as ut } from "vue";
9
- import { useWindowSize as pt, useEventListener as J, useStorage as xt, isClient as $t, useMouse as lt, useMousePressed as kt, useKeyModifier as nt, useFps as Ct, useRafFn as Mt } from "@vueuse/core";
10
- function E(e) {
11
- return typeof e == "function" ? e() : K(e);
8
+ import { unref as k, isRef as H, toRefs as q, customRef as $t, ref as b, watch as N, computed as P, defineComponent as w, reactive as V, h as kt, provide as pt, isReactive as Mt, onUnmounted as Ct, openBlock as d, createElementBlock as v, normalizeClass as C, Fragment as K, createTextVNode as J, toDisplayString as M, createVNode as F, createElementVNode as i, withDirectives as Q, vShow as Z, normalizeStyle as Et, renderList as B, createCommentVNode as W, watchEffect as Tt, createBlock as I, Transition as ft, withCtx as R, renderSlot as mt } from "vue";
9
+ import { useWindowSize as vt, useEventListener as tt, useStorage as St, isClient as It, useFps as Ft, useMemory as At, useRafFn as bt, useMouse as st, useMousePressed as Dt, useKeyModifier as ut } from "@vueuse/core";
10
+ import { useTresContext as Kt } from "@tresjs/core";
11
+ function O(e) {
12
+ return typeof e == "function" ? e() : k(e);
12
13
  }
13
- const dt = typeof window < "u" && typeof document < "u";
14
+ const gt = typeof window < "u" && typeof document < "u";
14
15
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
15
- function St(e, o = {}) {
16
- if (!G(e))
17
- return B(e);
16
+ function Pt(e, n = {}) {
17
+ if (!H(e))
18
+ return q(e);
18
19
  const l = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
19
- for (const n in e.value)
20
- l[n] = gt(() => ({
20
+ for (const o in e.value)
21
+ l[o] = $t(() => ({
21
22
  get() {
22
- return e.value[n];
23
+ return e.value[o];
23
24
  },
24
25
  set(t) {
25
- var i;
26
- if ((i = E(o.replaceRef)) != null ? i : !0)
26
+ var c;
27
+ if ((c = O(n.replaceRef)) != null ? c : !0)
27
28
  if (Array.isArray(e.value)) {
28
- const c = [...e.value];
29
- c[n] = t, e.value = c;
29
+ const s = [...e.value];
30
+ s[o] = t, e.value = s;
30
31
  } else {
31
- const c = { ...e.value, [n]: t };
32
- Object.setPrototypeOf(c, Object.getPrototypeOf(e.value)), e.value = c;
32
+ const s = { ...e.value, [o]: t };
33
+ Object.setPrototypeOf(s, Object.getPrototypeOf(e.value)), e.value = s;
33
34
  }
34
35
  else
35
- e.value[n] = t;
36
+ e.value[o] = t;
36
37
  }
37
38
  }));
38
39
  return l;
39
40
  }
40
- const Tt = dt ? window : void 0;
41
- function At(e, o = {}) {
41
+ const Vt = gt ? window : void 0;
42
+ function Ut(e, n = {}) {
42
43
  const {
43
44
  pointerTypes: l,
44
- preventDefault: n,
45
+ preventDefault: o,
45
46
  stopPropagation: t,
46
- exact: i,
47
- onMove: r,
48
- onEnd: c,
49
- onStart: u,
50
- initialValue: _,
51
- axis: y = "both",
52
- draggingElement: s = Tt,
53
- handle: a = e
54
- } = o, { width: m } = pt();
55
- let S = m.value;
56
- const v = d(
57
- E(_) ?? { x: 0, y: 0 }
47
+ exact: c,
48
+ onMove: a,
49
+ onEnd: s,
50
+ onStart: f,
51
+ initialValue: y,
52
+ axis: g = "both",
53
+ draggingElement: u = Vt,
54
+ handle: r = e
55
+ } = n, { width: p } = vt();
56
+ let E = p.value;
57
+ const m = b(
58
+ O(y) ?? { x: 0, y: 0 }
58
59
  );
59
- O(m, () => {
60
- const g = m.value - S;
61
- v.value.x += g, S = m.value;
60
+ N(p, () => {
61
+ const _ = p.value - E;
62
+ m.value.x += _, E = p.value;
62
63
  });
63
- const T = d(), D = (g) => l ? l.includes(g.pointerType) : !0, $ = (g) => {
64
- E(n) && g.preventDefault(), E(t) && g.stopPropagation();
65
- }, A = (g) => {
66
- if (!D(g) || E(i) && g.target !== E(e))
64
+ const S = b(), U = (_) => l ? l.includes(_.pointerType) : !0, T = (_) => {
65
+ O(o) && _.preventDefault(), O(t) && _.stopPropagation();
66
+ }, A = (_) => {
67
+ if (!U(_) || O(c) && _.target !== O(e))
67
68
  return;
68
- const b = E(e).getBoundingClientRect(), x = {
69
- x: g.clientX - b.left,
70
- y: g.clientY - b.top
69
+ const h = O(e).getBoundingClientRect(), $ = {
70
+ x: _.clientX - h.left,
71
+ y: _.clientY - h.top
71
72
  };
72
- (u == null ? void 0 : u(x, g)) !== !1 && (T.value = x, $(g));
73
- }, q = (g) => {
74
- if (!D(g) || !T.value)
73
+ (f == null ? void 0 : f($, _)) !== !1 && (S.value = $, T(_));
74
+ }, L = (_) => {
75
+ if (!U(_) || !S.value)
75
76
  return;
76
- let { x: b, y: x } = v.value;
77
- (y === "x" || y === "both") && (b = g.clientX - T.value.x), (y === "y" || y === "both") && (x = g.clientY - T.value.y), v.value = {
78
- x: b,
79
- y: x
80
- }, r == null || r(v.value, g), $(g);
81
- }, P = (g) => {
82
- D(g) && T.value && (T.value = void 0, c == null || c(v.value, g), $(g));
77
+ let { x: h, y: $ } = m.value;
78
+ (g === "x" || g === "both") && (h = _.clientX - S.value.x), (g === "y" || g === "both") && ($ = _.clientY - S.value.y), m.value = {
79
+ x: h,
80
+ y: $
81
+ }, a == null || a(m.value, _), T(_);
82
+ }, Y = (_) => {
83
+ U(_) && S.value && (S.value = void 0, s == null || s(m.value, _), T(_));
83
84
  };
84
- if (dt) {
85
- const g = { capture: o.capture ?? !0 };
86
- J(a, "pointerdown", A, g), J(s, "pointermove", q, g), J(s, "pointerup", P, g);
85
+ if (gt) {
86
+ const _ = { capture: n.capture ?? !0 };
87
+ tt(r, "pointerdown", A, _), tt(u, "pointermove", L, _), tt(u, "pointerup", Y, _);
87
88
  }
88
89
  return {
89
- ...St(v),
90
- position: v,
91
- isDragging: z(() => !!T.value),
92
- style: z(
93
- () => `left:${v.value.x}px;top:${v.value.y}px;`
90
+ ...Pt(m),
91
+ position: m,
92
+ isDragging: P(() => !!S.value),
93
+ style: P(
94
+ () => `left:${m.value.x}px;top:${m.value.y}px;`
94
95
  )
95
96
  };
96
97
  }
97
- const It = /* @__PURE__ */ k({
98
+ const Ot = /* @__PURE__ */ w({
98
99
  name: "UseDraggable",
99
100
  props: [
100
101
  "storageKey",
@@ -111,155 +112,236 @@ const It = /* @__PURE__ */ k({
111
112
  "onMove",
112
113
  "onEnd"
113
114
  ],
114
- setup(e, { slots: o }) {
115
- const l = d(), n = z(() => e.handle ?? l.value), t = e.storageKey && xt(
115
+ setup(e, { slots: n }) {
116
+ const l = b(), o = P(() => e.handle ?? l.value), t = e.storageKey && St(
116
117
  e.storageKey,
117
- E(e.initialValue) || { x: 0, y: 0 },
118
- $t ? e.storageType === "session" ? sessionStorage : localStorage : void 0
119
- ), i = t || e.initialValue || { x: 0, y: 0 }, c = N(At(l, {
118
+ O(e.initialValue) || { x: 0, y: 0 },
119
+ It ? e.storageType === "session" ? sessionStorage : localStorage : void 0
120
+ ), c = t || e.initialValue || { x: 0, y: 0 }, s = V(Ut(l, {
120
121
  ...e,
121
- handle: n,
122
- initialValue: i,
123
- onEnd: (u, _) => {
124
- var y;
125
- (y = e.onEnd) == null || y.call(e, u, _), t && (t.value.x = u.x, t.value.y = u.y);
122
+ handle: o,
123
+ initialValue: c,
124
+ onEnd: (f, y) => {
125
+ var g;
126
+ (g = e.onEnd) == null || g.call(e, f, y), t && (t.value.x = f.x, t.value.y = f.y);
126
127
  }
127
128
  }));
128
129
  return () => {
129
- if (o.default)
130
- return mt(e.as || "div", { ref: l, style: `touch-action:none;${c.style}` }, o.default(c));
130
+ if (n.default)
131
+ return kt(e.as || "div", { ref: l, style: `touch-action:none;${s.style}` }, n.default(s));
131
132
  };
132
133
  }
133
- }), Kt = Symbol("CONTROLS_CONTEXT_KEY"), ft = "default", L = N({});
134
- function Dt(e = ft) {
135
- return yt(Kt, L), L[e];
134
+ }), Bt = Symbol("CONTROLS_CONTEXT_KEY"), yt = "default", X = V({});
135
+ function Lt(e = yt) {
136
+ return pt(Bt, X), X[e];
136
137
  }
137
- const Q = (e) => {
138
- const o = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
139
- return typeof e == "boolean" ? "boolean" : typeof e == "number" ? "number" : typeof e == "string" && o.test(e) ? "color" : typeof e == "string" ? "string" : e.isVector3 || e.isVector2 || e.isEuler || e.value instanceof Array || e.value.isVector3 || e.value.isVector2 || e.value.isEuler || e.value.value instanceof Array ? "vector" : e.min !== void 0 || e.max !== void 0 || e.step !== void 0 ? "range" : e.options && Array.isArray(e.options) ? "select" : "unknown";
140
- }, Y = (e, o, l, n) => {
138
+ const et = (e) => {
139
+ const n = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
140
+ return typeof e == "boolean" ? "boolean" : typeof e == "number" ? "number" : typeof e == "string" && n.test(e) ? "color" : typeof e == "string" ? "string" : e.isVector3 || e.isVector2 || e.isEuler || e.value instanceof Array || e.value.isVector3 || e.value.isVector2 || e.value.isEuler || e.value.value instanceof Array ? "vector" : e.min !== void 0 || e.max !== void 0 || e.step !== void 0 ? "range" : e.options && Array.isArray(e.options) ? "select" : "unknown";
141
+ }, G = (e, n, l, o) => {
141
142
  const t = {
142
- key: d(e),
143
- label: d(e),
144
- name: d(e),
145
- type: d(l),
146
- value: d(o),
147
- visible: d(!0),
148
- icon: d(),
149
- uniqueKey: d(e),
150
- [e]: d(o)
143
+ key: b(e),
144
+ label: b(e),
145
+ name: b(e),
146
+ type: b(l),
147
+ value: b(n),
148
+ visible: b(!0),
149
+ icon: b(),
150
+ uniqueKey: b(e),
151
+ [e]: b(n)
151
152
  };
152
- return n && (t.folder = d(n)), t;
153
- }, De = (e, o, l) => {
154
- const n = {}, t = typeof e == "string" ? e : null, i = t ? o : e, r = t && t !== "fpsgraph" ? l : o, c = (r == null ? void 0 : r.uuid) || ft;
155
- if (L[c] || (L[c] = N({})), e === "fpsgraph") {
156
- const s = Y("fpsgraph", null, "fpsgraph", null);
157
- return L[c].fpsgraph = s, n.fpsgraph = s, B(N(n));
153
+ return o && (t.folder = b(o)), t;
154
+ }, bl = (e, n, l) => {
155
+ const o = {}, t = typeof e == "string" ? e : null, c = t ? n : e, a = t && t !== "fpsgraph" ? l : n, s = (a == null ? void 0 : a.uuid) || yt;
156
+ if (X[s] || (X[s] = V({})), e === "fpsgraph") {
157
+ const u = G("fpsgraph", null, "fpsgraph", null);
158
+ return X[s].fpsgraph = u, o.fpsgraph = u, q(V(o));
158
159
  }
159
- const u = L[c], _ = ht(i), y = _ ? B(i) : {};
160
- for (const s in i) {
161
- let a = i[s], m = s;
162
- if (_ && y[s] && (a = y[s]), t && (m = `${t}${s.charAt(0).toUpperCase() + s.slice(1)}`), typeof a == "object" && !G(a) && !Array.isArray(a) && a.value !== void 0) {
163
- const v = a, T = G(v.value) ? v.value : d(v.value), D = v.type || Q(v), $ = Y(s, T, D, t);
164
- D === "select" && ($.options = d(v.options.map((A) => typeof A == "object" && A.text && A.value ? A : {
160
+ const f = X[s], y = Mt(c), g = y ? q(c) : {};
161
+ for (const u in c) {
162
+ let r = c[u], p = u;
163
+ if (y && g[u] && (r = g[u]), t && (p = `${t}${u.charAt(0).toUpperCase() + u.slice(1)}`), typeof r == "object" && !H(r) && !Array.isArray(r) && r.value !== void 0) {
164
+ const m = r, S = H(m.value) ? m.value : b(m.value), U = m.type || et(m), T = G(u, S, U, t);
165
+ U === "select" && (T.options = b(m.options.map((A) => typeof A == "object" && A.text && A.value ? A : {
165
166
  text: A,
166
167
  value: A
167
- }))), D === "range" && ($.min = d(v.min || 0), $.max = d(v.max || 1), $.step = d(v.step || 0.1)), $.label.value = v.label || s, $.icon.value = v.icon, $.visible.value = v.visible !== void 0 ? v.visible : !0, $.uniqueKey.value = m, u[m] = $, n[m] = $;
168
+ }))), U === "range" && (T.min = b(m.min || 0), T.max = b(m.max || 1), T.step = b(m.step || 0.1)), T.label.value = m.label || u, T.icon.value = m.icon, T.visible.value = m.visible !== void 0 ? m.visible : !0, T.uniqueKey.value = p, f[p] = T, o[p] = T;
168
169
  continue;
169
170
  }
170
- if (G(a)) {
171
- const v = Y(s, a, a.value.type || Q(a.value), t);
172
- u[m] = v, n[m] = v;
171
+ if (H(r)) {
172
+ const m = G(u, r, r.value.type || et(r.value), t);
173
+ f[p] = m, o[p] = m;
173
174
  continue;
174
- } else if (typeof a == "object" && !Array.isArray(a)) {
175
- const v = B(a);
176
- v[s] && (a = v[s]);
175
+ } else if (typeof r == "object" && !Array.isArray(r)) {
176
+ const m = q(r);
177
+ m[u] && (r = m[u]);
177
178
  }
178
- const S = Y(s, a, a.type || Q(a), t);
179
- u[m] = S, n[m] = S, S.uniqueKey.value = m;
179
+ const E = G(u, r, r.type || et(r), t);
180
+ f[p] = E, o[p] = E, E.uniqueKey.value = p;
180
181
  }
181
- return Object.keys(n).length > 1 ? B(N(n)) : Object.values(n)[0];
182
- }, Ft = ["for", "title"], R = /* @__PURE__ */ k({
182
+ return Object.keys(o).length > 1 ? q(V(o)) : Object.values(o)[0];
183
+ };
184
+ function zt(e) {
185
+ if (typeof e == "number")
186
+ return [e, e, e];
187
+ if (rt(e)) {
188
+ const { x: n, y: l, z: o } = e;
189
+ return [n, l, o];
190
+ }
191
+ if (nt(e)) {
192
+ const { x: n, y: l } = e;
193
+ return [n, l];
194
+ }
195
+ return e;
196
+ }
197
+ function nt(e) {
198
+ return e && typeof e.x == "number" && typeof e.y == "number";
199
+ }
200
+ function rt(e) {
201
+ return e && typeof e.x == "number" && typeof e.y == "number" && typeof e.z == "number";
202
+ }
203
+ function Rt(e) {
204
+ let n = 0;
205
+ return e.traverse((l) => {
206
+ if (l.isMesh && l.geometry) {
207
+ const o = l.geometry, t = o.attributes.position.count * 3 * Float32Array.BYTES_PER_ELEMENT, c = o.index ? o.index.count * Uint32Array.BYTES_PER_ELEMENT : 0, a = o.attributes.normal ? o.attributes.normal.count * 3 * Float32Array.BYTES_PER_ELEMENT : 0, s = o.attributes.uv ? o.attributes.uv.count * 2 * Float32Array.BYTES_PER_ELEMENT : 0, f = t + c + a + s;
208
+ n += f;
209
+ }
210
+ }), n;
211
+ }
212
+ function qt(e) {
213
+ return (e / 1024).toFixed(2);
214
+ }
215
+ const Nt = Symbol("PERF_CONTEXT_KEY"), it = "default", at = V({
216
+ [it]: {
217
+ perf: {
218
+ fps: V({
219
+ value: 0,
220
+ accumulator: [],
221
+ lastLoggedTime: Date.now(),
222
+ logInterval: 1e3
223
+ }),
224
+ memory: V({
225
+ currentMem: 0,
226
+ averageMem: 0,
227
+ maxMemory: 0,
228
+ allocatedMem: 0,
229
+ accumulator: [],
230
+ lastLoggedTime: Date.now(),
231
+ logInterval: 1e3
232
+ }),
233
+ // Placeholder for memory object
234
+ gl: void 0,
235
+ scene: void 0
236
+ }
237
+ }
238
+ });
239
+ function ct(e = it) {
240
+ return pt(Nt, at), at[e].perf;
241
+ }
242
+ function Xt(e) {
243
+ const { renderer: n, scene: l } = Kt(), o = (e == null ? void 0 : e.renderer) || n.value;
244
+ if (!o)
245
+ throw new Error("Renderer not found");
246
+ const t = at[it].perf;
247
+ t.gl = o, t.scene = l.value;
248
+ const c = 100, a = Ft({ every: c }), { isSupported: s, memory: f } = At({ interval: c }), y = 80;
249
+ let g = performance.now();
250
+ const u = ({ timestamp: E }) => {
251
+ t.memory.allocatedMem = Rt(k(l)), E - g >= c && (g = E, t.fps.accumulator.push(a.value), t.fps.accumulator.length > y && t.fps.accumulator.shift(), t.fps.value = t.fps.accumulator.reduce((m, S) => m + S, 0) / t.fps.accumulator.length, s.value && f.value && (t.memory.accumulator.push(f.value.usedJSHeapSize / 1024 / 1024), t.memory.accumulator.length > y && t.memory.accumulator.shift(), t.memory.currentMem = t.memory.accumulator.reduce((m, S) => m + S, 0) / t.memory.accumulator.length));
252
+ }, { pause: r, resume: p } = bt(u, { immediate: !0 });
253
+ return Ct(() => {
254
+ r();
255
+ }), {
256
+ perf: t,
257
+ fps: t.fps,
258
+ memory: t.memory,
259
+ gl: t.gl,
260
+ pausePerfTracking: r,
261
+ resumePerfTracking: p
262
+ };
263
+ }
264
+ const Yt = ["for", "title"], j = /* @__PURE__ */ w({
183
265
  __name: "ControlLabel",
184
266
  props: {
185
267
  label: {},
186
268
  control: {}
187
269
  },
188
270
  setup(e) {
189
- return (o, l) => (p(), h("label", {
190
- for: o.control.uniqueKey,
191
- title: o.label,
271
+ return (n, l) => (d(), v("label", {
272
+ for: n.control.uniqueKey,
273
+ title: n.label,
192
274
  class: "tl-text-gray-500 tl-w-1/3 tl-truncate"
193
275
  }, [
194
- o.control.icon ? (p(), h("i", {
276
+ n.control.icon ? (d(), v("i", {
195
277
  key: 0,
196
- class: M(o.control.icon)
197
- }, null, 2)) : (p(), h(V, { key: 1 }, [
198
- st(F(o.label), 1)
278
+ class: C(n.control.icon)
279
+ }, null, 2)) : (d(), v(K, { key: 1 }, [
280
+ J(M(n.label), 1)
199
281
  ], 64))
200
- ], 8, Ft));
282
+ ], 8, Yt));
201
283
  }
202
- }), Et = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2" }, Vt = ["id", "value", "min", "max", "step"], zt = /* @__PURE__ */ k({
284
+ }), Wt = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2" }, jt = ["id", "value", "min", "max", "step"], Gt = /* @__PURE__ */ w({
203
285
  __name: "NumberControl",
204
286
  props: {
205
287
  label: {},
206
288
  control: {}
207
289
  },
208
290
  emits: ["change"],
209
- setup(e, { emit: o }) {
210
- const l = e, n = o;
211
- function t(s) {
212
- const { target: a } = s;
213
- n("change", a.valueAsNumber);
291
+ setup(e, { emit: n }) {
292
+ const l = e, o = n;
293
+ function t(u) {
294
+ const { target: r } = u;
295
+ o("change", r.valueAsNumber);
214
296
  }
215
- const i = lt(), r = d(0), c = d(!1), u = (s) => {
216
- r.value = s.clientX, c.value = !0;
217
- }, _ = () => {
218
- c.value = !1;
219
- }, y = (s) => Math.floor(Math.abs(s) / 10);
220
- return O(i.x, (s) => {
221
- if (c.value) {
222
- const a = s - r.value, m = y(a);
223
- a > 0 ? n("change", l.control.value + 1 + m) : a < 0 && n("change", l.control.value - 1 + m), l.control.min !== void 0 && l.control.value < l.control.min && n("change", l.control.min), l.control.max !== void 0 && l.control.value > l.control.max && n("change", l.control.max), r.value = s;
297
+ const c = st(), a = b(0), s = b(!1), f = (u) => {
298
+ a.value = u.clientX, s.value = !0;
299
+ }, y = () => {
300
+ s.value = !1;
301
+ }, g = (u) => Math.floor(Math.abs(u) / 10);
302
+ return N(c.x, (u) => {
303
+ if (s.value) {
304
+ const r = u - a.value, p = g(r);
305
+ r > 0 ? o("change", l.control.value + 1 + p) : r < 0 && o("change", l.control.value - 1 + p), l.control.min !== void 0 && l.control.value < l.control.min && o("change", l.control.min), l.control.max !== void 0 && l.control.value > l.control.max && o("change", l.control.max), a.value = u;
224
306
  }
225
- }), (s, a) => (p(), h("div", Et, [
226
- X(R, {
227
- label: s.label,
228
- control: s.control
307
+ }), (u, r) => (d(), v("div", Wt, [
308
+ F(j, {
309
+ label: u.label,
310
+ control: u.control
229
311
  }, null, 8, ["label", "control"]),
230
- f("input", {
231
- id: s.control.uniqueKey,
232
- value: s.control.value,
233
- class: M(["tl-p-2 tl-w-1/3 tl-rounded tl-text-right tl-text-xs tl-text-gray-400 tl-bg-gray-100 tl-focus:border-gray-200 tl-outline-none tl-border-none tl-font-sans", { "tl-cursor-ew-resize": c.value }]),
312
+ i("input", {
313
+ id: u.control.uniqueKey,
314
+ value: u.control.value,
315
+ class: C(["tl-p-2 tl-w-1/3 tl-rounded tl-text-right tl-text-xs tl-text-gray-400 tl-bg-gray-100 tl-focus:border-gray-200 tl-outline-none tl-border-none tl-font-sans", { "tl-cursor-ew-resize": s.value }]),
234
316
  type: "number",
235
- min: s.control.min,
236
- max: s.control.max,
237
- step: s.control.step,
317
+ min: u.control.min,
318
+ max: u.control.max,
319
+ step: u.control.step,
238
320
  onInput: t,
239
- onMousedown: u,
240
- onMouseup: _
241
- }, null, 42, Vt)
321
+ onMousedown: f,
322
+ onMouseup: y
323
+ }, null, 42, jt)
242
324
  ]));
243
325
  }
244
- }), qt = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2 tl-min-h-32px" }, Ut = ["id", "value", "aria-label"], Ot = /* @__PURE__ */ k({
326
+ }), Ht = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2 tl-min-h-32px" }, Jt = ["id", "value", "aria-label"], Qt = /* @__PURE__ */ w({
245
327
  __name: "TextControl",
246
328
  props: {
247
329
  label: {},
248
330
  control: {}
249
331
  },
250
332
  emits: ["change"],
251
- setup(e, { emit: o }) {
252
- const l = o;
253
- function n(t) {
254
- const { target: i } = t;
255
- l("change", i.value);
333
+ setup(e, { emit: n }) {
334
+ const l = n;
335
+ function o(t) {
336
+ const { target: c } = t;
337
+ l("change", c.value);
256
338
  }
257
- return (t, i) => (p(), h("div", qt, [
258
- X(R, {
339
+ return (t, c) => (d(), v("div", Ht, [
340
+ F(j, {
259
341
  label: t.label,
260
342
  control: t.control
261
343
  }, null, 8, ["label", "control"]),
262
- f("input", {
344
+ i("input", {
263
345
  id: t.control.uniqueKey,
264
346
  value: t.control.value,
265
347
  type: "text",
@@ -267,504 +349,721 @@ const Q = (e) => {
267
349
  class: "tl-p-2 tl-w-2/3 tl-rounded tl-text-right tl-text-xs tl-text-gray-400 tl-bg-gray-100 focus:tl-border-gray-200 tl-border-none tl-font-sans",
268
350
  "aria-label": t.label,
269
351
  placeholder: "Enter value here...",
270
- onChange: n
271
- }, null, 40, Ut)
352
+ onChange: o
353
+ }, null, 40, Jt)
272
354
  ]));
273
355
  }
274
- }), Xt = { class: "tl-flex tl-px-4 tl-justify-start tl-gap-2 tl-items-center tl-mb-2 tl-min-h-32px" }, Bt = { class: "tl-text-gray-500 tl-w-1/3" }, Lt = ["id", "checked"], Pt = ["for"], Wt = ["aria-checked"], Nt = { class: "i-ic:baseline-check tl-text-light" }, jt = /* @__PURE__ */ k({
356
+ }), Zt = { class: "tl-flex tl-px-4 tl-justify-start tl-gap-2 tl-items-center tl-mb-2 tl-min-h-32px" }, te = { class: "tl-text-gray-500 tl-w-1/3" }, ee = ["id", "checked"], le = ["for"], oe = ["aria-checked"], ne = { class: "i-ic:baseline-check tl-text-light" }, re = /* @__PURE__ */ w({
275
357
  __name: "BooleanControl",
276
358
  props: {
277
359
  label: {},
278
360
  control: {}
279
361
  },
280
362
  emits: ["change"],
281
- setup(e, { emit: o }) {
282
- const l = e, n = o;
283
- function t(r) {
284
- const { target: c } = r;
285
- n("change", c.checked);
363
+ setup(e, { emit: n }) {
364
+ const l = e, o = n;
365
+ function t(a) {
366
+ const { target: s } = a;
367
+ o("change", s.checked);
286
368
  }
287
- function i(r) {
288
- (r.code === "Space" || r.code === "Enter") && (r.preventDefault(), n("change", !l.control.value));
369
+ function c(a) {
370
+ (a.code === "Space" || a.code === "Enter") && (a.preventDefault(), o("change", !l.control.value));
289
371
  }
290
- return (r, c) => (p(), h("div", Xt, [
291
- f("label", Bt, F(r.label), 1),
292
- f("input", {
293
- id: r.control.uniqueKey,
294
- checked: r.control.value,
372
+ return (a, s) => (d(), v("div", Zt, [
373
+ i("label", te, M(a.label), 1),
374
+ i("input", {
375
+ id: a.control.uniqueKey,
376
+ checked: a.control.value,
295
377
  class: "tl-hidden",
296
378
  type: "checkbox",
297
379
  onInput: t
298
- }, null, 40, Lt),
299
- f("label", {
300
- for: r.control.uniqueKey,
380
+ }, null, 40, ee),
381
+ i("label", {
382
+ for: a.control.uniqueKey,
301
383
  class: "tl-inline-flex tl-items-center tl-cursor-pointer"
302
384
  }, [
303
- f("span", {
385
+ i("span", {
304
386
  tabindex: "0",
305
387
  role: "checkbox",
306
- "aria-checked": r.control.value.toString(),
307
- class: M([{ "tl-bg-dark-500": r.control.value, "tl-bg-gray-200": !r.control.value }, "tl-w-4 tl-h-4 tl-flex tl-justify-center tl-items-center tl-rounded tl-border tl-border-gray-300 tl-mr-2 tl-transition-colors tl-duration-200"]),
308
- onKeydown: i
388
+ "aria-checked": a.control.value.toString(),
389
+ class: C([{ "tl-bg-dark-500": a.control.value, "tl-bg-gray-200": !a.control.value }, "tl-w-4 tl-h-4 tl-flex tl-justify-center tl-items-center tl-rounded tl-border tl-border-gray-300 tl-mr-2 tl-transition-colors tl-duration-200"]),
390
+ onKeydown: c
309
391
  }, [
310
- ct(f("i", Nt, null, 512), [
311
- [it, r.control.value]
392
+ Q(i("i", ne, null, 512), [
393
+ [Z, a.control.value]
312
394
  ])
313
- ], 42, Wt)
314
- ], 8, Pt)
395
+ ], 42, oe)
396
+ ], 8, le)
315
397
  ]));
316
398
  }
317
- }), Rt = { class: "tl-px-4 tl-relative tl-flex tl-justify-between tl-gap-4 tl-items-center tl-mb-2" }, Yt = ["value", "min", "max", "step"], Gt = ["value", "min", "max", "step"], Ht = /* @__PURE__ */ k({
399
+ }), ae = { class: "tl-px-4 tl-relative tl-flex tl-justify-between tl-gap-4 tl-items-center tl-mb-2" }, se = ["value", "min", "max", "step"], ie = ["value", "min", "max", "step"], ce = /* @__PURE__ */ w({
318
400
  __name: "SliderControl",
319
401
  props: {
320
402
  label: {},
321
403
  control: {}
322
404
  },
323
405
  emits: ["change"],
324
- setup(e, { emit: o }) {
325
- const l = e, n = o;
326
- function t(a) {
327
- const { target: m } = a;
328
- n("change", m.valueAsNumber);
406
+ setup(e, { emit: n }) {
407
+ const l = e, o = n;
408
+ function t(r) {
409
+ const { target: p } = r;
410
+ o("change", p.valueAsNumber);
329
411
  }
330
- const i = z(() => ({
412
+ const c = P(() => ({
331
413
  backgroundImage: `linear-gradient(to right, #333 0% ${100 * (l.control.value - (l.control.min || 0)) / ((l.control.max || 100) - (l.control.min || 0))}%, #e2e2e2 0%)`
332
- })), r = lt(), c = d(0), u = d(!1), _ = (a) => {
333
- c.value = a.clientX, u.value = !0;
334
- }, y = () => {
335
- u.value = !1;
336
- }, s = (a) => Math.floor(Math.abs(a) / 10);
337
- return O(r.x, (a) => {
338
- if (u.value) {
339
- const m = a - c.value, S = s(m);
340
- m > 0 ? n("change", l.control.value + 1 + S) : m < 0 && n("change", l.control.value - 1 + S), l.control.min !== void 0 && l.control.value < l.control.min && n("change", l.control.min), l.control.max !== void 0 && l.control.value > l.control.max && n("change", l.control.max), c.value = a;
414
+ })), a = st(), s = b(0), f = b(!1), y = (r) => {
415
+ s.value = r.clientX, f.value = !0;
416
+ }, g = () => {
417
+ f.value = !1;
418
+ }, u = (r) => Math.floor(Math.abs(r) / 10);
419
+ return N(a.x, (r) => {
420
+ if (f.value) {
421
+ const p = r - s.value, E = u(p);
422
+ p > 0 ? o("change", l.control.value + 1 + E) : p < 0 && o("change", l.control.value - 1 + E), l.control.min !== void 0 && l.control.value < l.control.min && o("change", l.control.min), l.control.max !== void 0 && l.control.value > l.control.max && o("change", l.control.max), s.value = r;
341
423
  }
342
- }), (a, m) => (p(), h("div", Rt, [
343
- X(R, {
344
- label: a.label,
345
- control: a.control
424
+ }), (r, p) => (d(), v("div", ae, [
425
+ F(j, {
426
+ label: r.label,
427
+ control: r.control
346
428
  }, null, 8, ["label", "control"]),
347
- f("input", {
348
- value: a.control.value,
429
+ i("input", {
430
+ value: r.control.value,
349
431
  class: "tl-w-1/2 tl-h-0.75 tl-bg-dark-200 tl-rounded-full tl-appearance-none",
350
- style: _t(i.value),
432
+ style: Et(c.value),
351
433
  type: "range",
352
- min: a.control.min,
353
- max: a.control.max,
354
- step: a.control.step,
434
+ min: r.control.min,
435
+ max: r.control.max,
436
+ step: r.control.step,
355
437
  onInput: t
356
- }, null, 44, Yt),
357
- f("input", {
358
- value: a.control.value,
359
- class: M(["tl-p-2 tl-w-1/4 tl-rounded tl-text-right tl-text-xs tl-text-gray-400 tl-bg-gray-100 tl-focus:border-gray-200 tl-outline-none tl-border-none tl-font-sans", { "tl-cursor-ew-resize": u.value }]),
438
+ }, null, 44, se),
439
+ i("input", {
440
+ value: r.control.value,
441
+ class: C(["tl-p-2 tl-w-1/4 tl-rounded tl-text-right tl-text-xs tl-text-gray-400 tl-bg-gray-100 tl-focus:border-gray-200 tl-outline-none tl-border-none tl-font-sans", { "tl-cursor-ew-resize": f.value }]),
360
442
  type: "number",
361
- min: a.control.min,
362
- max: a.control.max,
363
- step: a.control.step,
443
+ min: r.control.min,
444
+ max: r.control.max,
445
+ step: r.control.step,
364
446
  onInput: t,
365
- onMousedown: _,
366
- onMouseup: y
367
- }, null, 42, Gt)
447
+ onMousedown: y,
448
+ onMouseup: g
449
+ }, null, 42, ie)
368
450
  ]));
369
451
  }
370
- }), vt = (e, o) => {
452
+ }), ht = (e, n) => {
371
453
  const l = e.__vccOpts || e;
372
- for (const [n, t] of o)
373
- l[n] = t;
454
+ for (const [o, t] of n)
455
+ l[o] = t;
374
456
  return l;
375
- }, Jt = /* @__PURE__ */ vt(Ht, [["__scopeId", "data-v-e775088a"]]), Qt = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2" }, Zt = { class: "tl-text-gray-500 tl-w-1/3" }, te = ["id", "value", "aria-label"], ee = ["id", "aria-label", "value"], le = /* @__PURE__ */ k({
457
+ }, ue = /* @__PURE__ */ ht(ce, [["__scopeId", "data-v-e775088a"]]), de = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2" }, pe = { class: "tl-text-gray-500 tl-w-1/3" }, fe = ["id", "value", "aria-label"], me = ["id", "aria-label", "value"], ve = /* @__PURE__ */ w({
376
458
  __name: "ColorControl",
377
459
  props: {
378
460
  label: {},
379
461
  control: {}
380
462
  },
381
463
  emits: ["change"],
382
- setup(e, { emit: o }) {
383
- const l = o;
384
- function n(t) {
385
- const { target: i } = t;
386
- l("change", i.value);
464
+ setup(e, { emit: n }) {
465
+ const l = n;
466
+ function o(t) {
467
+ const { target: c } = t;
468
+ l("change", c.value);
387
469
  }
388
- return (t, i) => (p(), h("div", Qt, [
389
- f("label", Zt, F(t.label), 1),
390
- f("input", {
470
+ return (t, c) => (d(), v("div", de, [
471
+ i("label", pe, M(t.label), 1),
472
+ i("input", {
391
473
  id: t.control.uniqueKey,
392
474
  tabindex: "0",
393
475
  value: t.control.value,
394
476
  "aria-label": t.label,
395
- class: M(["focus:tl-outline-none focus:tl-ring-2 focus:tl-ring-blue-600", { "important-tl-outline-gray-200": t.control.value === "#ffffff" }]),
477
+ class: C(["focus:tl-outline-none focus:tl-ring-2 focus:tl-ring-blue-600", { "important-tl-outline-gray-200": t.control.value === "#ffffff" }]),
396
478
  type: "color",
397
- onInput: n
398
- }, null, 42, te),
399
- f("input", {
479
+ onInput: o
480
+ }, null, 42, fe),
481
+ i("input", {
400
482
  id: t.control.uniqueKey,
401
483
  tabindex: "0",
402
484
  "aria-label": t.label,
403
485
  value: t.control.value,
404
486
  class: "tl-p-2 tl-w-2/3 tl-rounded tl-text-right tl-text-xs tl-text-gray-400 tl-bg-gray-100 tl-border-none tl-font-sans",
405
487
  type: "text",
406
- onInput: n
407
- }, null, 40, ee)
488
+ onInput: o
489
+ }, null, 40, me)
408
490
  ]));
409
491
  }
410
- });
411
- function ne(e) {
412
- if (typeof e == "number")
413
- return [e, e, e];
414
- if (et(e)) {
415
- const { x: o, y: l, z: n } = e;
416
- return [o, l, n];
417
- }
418
- if (tt(e)) {
419
- const { x: o, y: l } = e;
420
- return [o, l];
421
- }
422
- return e;
423
- }
424
- function tt(e) {
425
- return e && typeof e.x == "number" && typeof e.y == "number";
426
- }
427
- function et(e) {
428
- return e && typeof e.x == "number" && typeof e.y == "number" && typeof e.z == "number";
429
- }
430
- const oe = { class: "tl-relative tl-w-2/3 tl-flex tl-justify-between tl-gap-0.5" }, ae = {
492
+ }), be = { class: "tl-relative tl-w-2/3 tl-flex tl-justify-between tl-gap-0.5" }, ge = {
431
493
  key: 0,
432
494
  class: "tl-font-bold tl-px-1 tl-py-1 tl-text-0.65rem tl-text-gray-300"
433
- }, re = ["id", "step", "value", "onInput", "onMousedown", "onMouseup", "onFocus"], se = /* @__PURE__ */ k({
495
+ }, ye = ["id", "step", "value", "onInput", "onMousedown", "onMouseup", "onFocus"], he = /* @__PURE__ */ w({
434
496
  __name: "VectorControl",
435
497
  props: {
436
498
  label: {},
437
499
  control: {}
438
500
  },
439
501
  emits: ["change"],
440
- setup(e, { emit: o }) {
441
- const l = e, n = o, t = lt(), { pressed: i } = kt(), r = d(0), c = d(!1), u = d(0), _ = d(null), y = d(1), s = nt("Shift"), a = nt("Alt");
442
- O(s, (b) => {
443
- y.value = b ? 10 : 1;
444
- }), O(a, (b) => {
445
- y.value = b ? 0.1 : 1;
502
+ setup(e, { emit: n }) {
503
+ const l = e, o = n, t = st(), { pressed: c } = Dt(), a = b(0), s = b(!1), f = b(0), y = b(null), g = b(1), u = ut("Shift"), r = ut("Alt");
504
+ N(u, (h) => {
505
+ g.value = h ? 10 : 1;
506
+ }), N(r, (h) => {
507
+ g.value = h ? 0.1 : 1;
446
508
  });
447
- const m = (b) => {
448
- _.value = b;
449
- }, S = () => {
450
- _.value = null;
451
- }, v = (b, x) => {
452
- u.value = x, r.value = b.clientX, c.value = !0;
453
- }, T = (b, x) => {
454
- u.value = x, c.value = !1;
455
- }, D = () => {
456
- c.value = !1;
509
+ const p = (h) => {
510
+ y.value = h;
511
+ }, E = () => {
512
+ y.value = null;
513
+ }, m = (h, $) => {
514
+ f.value = $, a.value = h.clientX, s.value = !0;
515
+ }, S = (h, $) => {
516
+ f.value = $, s.value = !1;
517
+ }, U = () => {
518
+ s.value = !1;
457
519
  };
458
- O(i, (b) => {
459
- b || (c.value = !1);
520
+ N(c, (h) => {
521
+ h || (s.value = !1);
460
522
  });
461
- const $ = (b) => Math.floor(Math.abs(b) / 10), A = z(() => ne(l.control.value)), q = d(["x", "y", "z"]), P = z(() => tt(l.control.value) || et(l.control.value));
462
- function g(b, x) {
463
- const { value: U } = l.control, { target: w } = b;
464
- u.value = x, U[P.value ? q.value[u.value] : u.value] = parseFloat(w.value), n("change", U);
523
+ const T = (h) => Math.floor(Math.abs(h) / 10), A = P(() => zt(l.control.value)), L = b(["x", "y", "z"]), Y = P(() => nt(l.control.value) || rt(l.control.value));
524
+ function _(h, $) {
525
+ const { value: z } = l.control, { target: x } = h;
526
+ f.value = $, z[Y.value ? L.value[f.value] : f.value] = parseFloat(x.value), o("change", z);
465
527
  }
466
- return O(t.x, (b) => {
467
- if (c.value) {
468
- const x = b - r.value, U = $(x), { value: w } = l.control, I = P.value ? q.value[u.value] : u.value;
469
- x > 0 ? w[I] += y.value + U : x < 0 && (w[I] -= y.value + U), l.control.min !== void 0 && w < l.control.min && (w[I] = l.control.min), l.control.max !== void 0 && w > l.control.max && (w[I] = l.control.max), n("change", w), r.value = b;
528
+ return N(t.x, (h) => {
529
+ if (s.value) {
530
+ const $ = h - a.value, z = T($), { value: x } = l.control, D = Y.value ? L.value[f.value] : f.value;
531
+ $ > 0 ? x[D] += g.value + z : $ < 0 && (x[D] -= g.value + z), l.control.min !== void 0 && x < l.control.min && (x[D] = l.control.min), l.control.max !== void 0 && x > l.control.max && (x[D] = l.control.max), o("change", x), a.value = h;
470
532
  }
471
- }), (b, x) => (p(), h("div", {
533
+ }), (h, $) => (d(), v("div", {
472
534
  class: "tl-flex tl-px-4 tl-justify-between tl-gap-1 tl-items-center tl-mb-2",
473
- onMouseup: x[0] || (x[0] = (U) => D())
535
+ onMouseup: $[0] || ($[0] = (z) => U())
474
536
  }, [
475
- X(R, {
476
- label: b.label,
477
- control: b.control
537
+ F(j, {
538
+ label: h.label,
539
+ control: h.control
478
540
  }, null, 8, ["label", "control"]),
479
- f("div", oe, [
480
- (p(!0), h(V, null, j(A.value, (U, w) => (p(), h("div", {
481
- key: b.label + w,
482
- class: M(["tl-flex tl-items-center tl-bg-gray-100 tl-rounded", {
483
- "tl-w-2/5": _.value === w,
484
- "tl-w-1/3": K(et)(b.control.value),
485
- "tl-w-1/2": K(tt)(b.control.value)
541
+ i("div", be, [
542
+ (d(!0), v(K, null, B(A.value, (z, x) => (d(), v("div", {
543
+ key: h.label + x,
544
+ class: C(["tl-flex tl-items-center tl-bg-gray-100 tl-rounded", {
545
+ "tl-w-2/5": y.value === x,
546
+ "tl-w-1/3": k(rt)(h.control.value),
547
+ "tl-w-1/2": k(nt)(h.control.value)
486
548
  }])
487
549
  }, [
488
- q.value[w] && P.value ? (p(), h("span", ae, F(q.value[w]), 1)) : H("", !0),
489
- f("input", {
490
- id: `${b.control.uniqueKey}-${q.value[w]}`,
550
+ L.value[x] && Y.value ? (d(), v("span", ge, M(L.value[x]), 1)) : W("", !0),
551
+ i("input", {
552
+ id: `${h.control.uniqueKey}-${L.value[x]}`,
491
553
  type: "number",
492
- step: y.value,
493
- class: M(["tl-w-full tl-px-0 tl-p-1 tl-text-right tl-text-0.65rem tl-text-gray-400 tl-bg-transparent focus:tl-border-gray-200 tl-outline-none tl-border-none tl-font-sans tl-appearence-none", { "tl-cursor-ew-resize": c.value }]),
494
- value: A.value[w].toFixed(2),
495
- onInput: (I) => g(I, w),
496
- onMousedown: (I) => v(I, w),
497
- onMouseup: (I) => T(I, w),
498
- onFocus: (I) => m(w),
499
- onBlur: S
500
- }, null, 42, re)
554
+ step: g.value,
555
+ class: C(["tl-w-full tl-px-0 tl-p-1 tl-text-right tl-text-0.65rem tl-text-gray-400 tl-bg-transparent focus:tl-border-gray-200 tl-outline-none tl-border-none tl-font-sans tl-appearence-none", { "tl-cursor-ew-resize": s.value }]),
556
+ value: A.value[x].toFixed(2),
557
+ onInput: (D) => _(D, x),
558
+ onMousedown: (D) => m(D, x),
559
+ onMouseup: (D) => S(D, x),
560
+ onFocus: (D) => p(x),
561
+ onBlur: E
562
+ }, null, 42, ye)
501
563
  ], 2))), 128))
502
564
  ])
503
565
  ], 32));
504
566
  }
505
- }), ce = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2" }, ie = { class: "tl-text-gray-500 tl-w-1/3" }, ue = { class: "tl-relative tl-w-2/3 tl-p-1 tl-rounded tl-text-right tl-text-xs tl-text-gray-400 tl-bg-gray-100 tl-focus:border-gray-200 tl-outline-none tl-border-none tl-font-sans" }, pe = { class: "tl-absolute tl-bottom-0.5 tl-right-0.5 tl-font-sans tl-text-xs" }, de = ["points"], ot = 160, Z = 40, W = 2, at = 100, rt = 20, fe = /* @__PURE__ */ k({
506
- __name: "FPSGraph",
567
+ }), _e = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2" }, xe = { class: "tl-text-gray-500 tl-w-1/3" }, we = { class: "tl-relative tl-w-2/3 tl-p-1 tl-rounded tl-text-right tl-text-xs tl-text-gray-400 tl-bg-gray-100 tl-focus:border-gray-200 tl-outline-none tl-border-none tl-font-sans" }, $e = { class: "tl-absolute tl-bottom-0.5 tl-right-0.5 tl-font-sans tl-text-xs" }, ke = ["points"], Me = 160, lt = 40, dt = 2, _t = /* @__PURE__ */ w({
568
+ __name: "Graph",
507
569
  props: {
508
- label: {},
509
- control: {}
570
+ points: {},
571
+ value: {},
572
+ unit: {},
573
+ label: {}
510
574
  },
511
575
  setup(e) {
512
- const o = Ct({ every: at }), l = d(""), n = d([]), t = d(ot / W);
513
- let i = performance.now();
514
- return Mt(({ timestamp: r }) => {
515
- r - i >= at && (i = r, n.value.push(o.value), n.value.length > t.value && n.value.shift(), l.value = n.value.map(
516
- (c, u) => `${u * W},${Z + rt - W / 2 - c * (Z + rt - W) / 120}`
517
- ).join(" "));
518
- }), (r, c) => (p(), h("div", ce, [
519
- f("label", ie, F(r.label), 1),
520
- f("div", ue, [
521
- f("div", pe, F(Math.round(K(o))) + " FPS ", 1),
522
- (p(), h("svg", {
523
- width: ot,
524
- height: Z,
576
+ const n = e, l = b(140);
577
+ Tt(() => {
578
+ const t = Math.max(...n.points, 30);
579
+ l.value = Math.max(t, l.value);
580
+ });
581
+ const o = P(() => n.points.map(
582
+ (t, c) => `${c * dt},${lt - t * lt / l.value}`
583
+ ).join(" "));
584
+ return (t, c) => (d(), v("div", _e, [
585
+ i("label", xe, M(t.label), 1),
586
+ i("div", we, [
587
+ i("div", $e, M(Math.round(t.value)) + " " + M(t.unit), 1),
588
+ (d(), v("svg", {
589
+ width: Me,
590
+ height: lt,
525
591
  xmlns: "http://www.w3.org/2000/svg",
526
592
  class: "tl-bg-gray-100"
527
593
  }, [
528
- f("polyline", {
529
- points: l.value,
594
+ i("polyline", {
595
+ points: o.value,
530
596
  fill: "none",
531
597
  stroke: "lightgray",
532
- "stroke-width": W,
598
+ "stroke-width": dt,
533
599
  "stroke-linecap": "round",
534
600
  "stroke-linejoin": "round"
535
- }, null, 8, de)
601
+ }, null, 8, ke)
536
602
  ]))
537
603
  ])
538
604
  ]));
539
605
  }
540
- }), ve = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2 tl-min-h-32px" }, be = ["id", "value"], ge = ["value"], me = /* @__PURE__ */ k({
606
+ }), Ce = /* @__PURE__ */ w({
607
+ __name: "FPSGraph",
608
+ props: {
609
+ label: {},
610
+ control: {}
611
+ },
612
+ setup(e) {
613
+ const { fps: n } = ct();
614
+ return (l, o) => (d(), I(_t, {
615
+ points: k(n).accumulator,
616
+ value: k(n).value,
617
+ unit: "FPS",
618
+ label: l.label
619
+ }, null, 8, ["points", "value", "label"]));
620
+ }
621
+ }), Ee = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2 tl-min-h-32px" }, Te = ["id", "value"], Se = ["value"], Ie = /* @__PURE__ */ w({
541
622
  __name: "SelectControl",
542
623
  props: {
543
624
  label: {},
544
625
  control: {}
545
626
  },
546
627
  emits: ["change"],
547
- setup(e, { emit: o }) {
548
- const l = o;
549
- function n(t) {
628
+ setup(e, { emit: n }) {
629
+ const l = n;
630
+ function o(t) {
550
631
  l("change", t.target.value);
551
632
  }
552
- return (t, i) => (p(), h("div", ve, [
553
- X(R, {
633
+ return (t, c) => (d(), v("div", Ee, [
634
+ F(j, {
554
635
  label: t.label,
555
636
  control: t.control
556
637
  }, null, 8, ["label", "control"]),
557
- f("select", {
638
+ i("select", {
558
639
  id: t.control.uniqueKey,
559
640
  value: t.control.value,
560
641
  class: "tl-p-2 tl-w-2/3 tl-rounded tl-text-left tl-text-xs tl-text-gray-400 tl-bg-gray-100 focus:tl-border-gray-200 tl-outline-none tl-border-none tl-font-sans",
561
- onChange: n
642
+ onChange: o
562
643
  }, [
563
- (p(!0), h(V, null, j(t.control.options, (r) => (p(), h("option", {
564
- key: r.value,
565
- value: r.value
566
- }, F(r.text), 9, ge))), 128))
567
- ], 40, be)
644
+ (d(!0), v(K, null, B(t.control.options, (a) => (d(), v("option", {
645
+ key: a.value,
646
+ value: a.value
647
+ }, M(a.text), 9, Se))), 128))
648
+ ], 40, Te)
568
649
  ]));
569
650
  }
570
- }), ye = /* @__PURE__ */ k({
651
+ }), Fe = /* @__PURE__ */ w({
571
652
  __name: "ButtonControl",
572
653
  props: {
573
654
  label: {},
574
655
  control: {}
575
656
  },
576
657
  setup(e) {
577
- const o = e, l = z(() => {
578
- const n = "leches-btn", t = `leches-btn-${o.control.value.variant || "primary"}`, i = `leches-btn-${o.control.value.size || "sm"}`;
579
- return [n, t, i];
658
+ const n = e, l = P(() => {
659
+ const o = "leches-btn", t = `leches-btn-${n.control.value.variant || "primary"}`, c = `leches-btn-${n.control.value.size || "sm"}`;
660
+ return [o, t, c];
580
661
  });
581
- return (n, t) => (p(), h("button", {
582
- class: M(l.value),
662
+ return (o, t) => (d(), v("button", {
663
+ class: C(l.value),
583
664
  onClick: t[0] || (t[0] = //@ts-ignore
584
- (...i) => n.control.value.onClick && n.control.value.onClick(...i))
665
+ (...c) => o.control.value.onClick && o.control.value.onClick(...c))
585
666
  }, [
586
- f("i", {
587
- class: M([n.control.value.icon, n.control.value.label ? "mr-1" : ""])
667
+ i("i", {
668
+ class: C([o.control.value.icon, o.control.value.label ? "mr-1" : ""])
588
669
  }, null, 2),
589
- st(" " + F(n.control.value.label), 1)
670
+ J(" " + M(o.control.value.label), 1)
590
671
  ], 2));
591
672
  }
592
- }), he = /* @__PURE__ */ vt(ye, [["__scopeId", "data-v-6a95ac59"]]), bt = /* @__PURE__ */ k({
673
+ }), Ae = /* @__PURE__ */ ht(Fe, [["__scopeId", "data-v-6a95ac59"]]), xt = /* @__PURE__ */ w({
593
674
  __name: "ControlInput",
594
675
  props: {
595
676
  control: {}
596
677
  },
597
678
  emits: ["change"],
598
- setup(e, { emit: o }) {
599
- const l = o;
600
- function n(t) {
679
+ setup(e, { emit: n }) {
680
+ const l = n;
681
+ function o(t) {
601
682
  l("change", t);
602
683
  }
603
- return (t, i) => t.control.visible ? (p(), h(V, { key: 0 }, [
604
- t.control.type === "color" ? (p(), C(le, {
684
+ return (t, c) => t.control.visible ? (d(), v(K, { key: 0 }, [
685
+ t.control.type === "color" ? (d(), I(ve, {
605
686
  key: 0,
606
687
  label: t.control.label,
607
688
  control: t.control,
608
- onChange: n
609
- }, null, 8, ["label", "control"])) : t.control.type === "select" ? (p(), C(me, {
689
+ onChange: o
690
+ }, null, 8, ["label", "control"])) : t.control.type === "select" ? (d(), I(Ie, {
610
691
  key: 1,
611
692
  label: t.control.label,
612
693
  control: t.control,
613
- onChange: n
614
- }, null, 8, ["label", "control"])) : t.control.type === "vector" ? (p(), C(se, {
694
+ onChange: o
695
+ }, null, 8, ["label", "control"])) : t.control.type === "vector" ? (d(), I(he, {
615
696
  key: 2,
616
697
  label: t.control.label,
617
698
  control: t.control,
618
- onChange: n
619
- }, null, 8, ["label", "control"])) : t.control.type === "boolean" ? (p(), C(jt, {
699
+ onChange: o
700
+ }, null, 8, ["label", "control"])) : t.control.type === "boolean" ? (d(), I(re, {
620
701
  key: 3,
621
702
  label: t.control.label,
622
703
  control: t.control,
623
- onChange: n
624
- }, null, 8, ["label", "control"])) : t.control.type === "fpsgraph" ? (p(), C(fe, {
704
+ onChange: o
705
+ }, null, 8, ["label", "control"])) : t.control.type === "fpsgraph" ? (d(), I(Ce, {
625
706
  key: 4,
626
707
  label: t.control.label,
627
708
  control: t.control
628
- }, null, 8, ["label", "control"])) : t.control.type === "number" ? (p(), C(zt, {
709
+ }, null, 8, ["label", "control"])) : t.control.type === "number" ? (d(), I(Gt, {
629
710
  key: 5,
630
711
  label: t.control.label,
631
712
  control: t.control,
632
- onChange: n
633
- }, null, 8, ["label", "control"])) : t.control.type === "range" ? (p(), C(Jt, {
713
+ onChange: o
714
+ }, null, 8, ["label", "control"])) : t.control.type === "range" ? (d(), I(ue, {
634
715
  key: 6,
635
716
  label: t.control.label,
636
717
  control: t.control,
637
- onChange: n
638
- }, null, 8, ["label", "control"])) : t.control.type === "button" ? (p(), h("div", {
718
+ onChange: o
719
+ }, null, 8, ["label", "control"])) : t.control.type === "button" ? (d(), v("div", {
639
720
  key: 7,
640
- class: M(["tl-p-2", t.control.value.size === "tl-block" ? "tl-flex" : "tl-inline-flex"])
721
+ class: C(["tl-p-2", t.control.value.size === "tl-block" ? "tl-flex" : "tl-inline-flex"])
641
722
  }, [
642
- X(he, {
723
+ F(Ae, {
643
724
  label: t.control.label,
644
725
  control: t.control
645
726
  }, null, 8, ["label", "control"])
646
- ], 2)) : (p(), C(Ot, {
727
+ ], 2)) : (d(), I(Qt, {
647
728
  key: 8,
648
729
  label: t.control.label,
649
730
  control: t.control,
650
- onChange: n
731
+ onChange: o
651
732
  }, null, 8, ["label", "control"]))
652
- ], 64)) : H("", !0);
733
+ ], 64)) : W("", !0);
653
734
  }
654
- }), _e = { class: "tl-mb-4" }, we = ["aria-expanded", "data-folder"], xe = {
735
+ }), De = { class: "tl-mb-4" }, Ke = ["aria-expanded", "data-folder"], Pe = {
655
736
  class: "tl-bg-white tl-rounded-b tl-pt-4",
656
737
  role: "menu"
657
- }, $e = /* @__PURE__ */ k({
738
+ }, Ve = /* @__PURE__ */ w({
658
739
  __name: "Folder",
659
740
  props: {
660
741
  controls: {},
661
742
  label: {}
662
743
  },
663
744
  setup(e) {
664
- function o(t, i) {
665
- i.value = t;
745
+ function n(t, c) {
746
+ c.value = t;
666
747
  }
667
- const l = d(!1), n = () => {
748
+ const l = b(!1), o = () => {
668
749
  l.value = !l.value;
669
750
  };
670
- return (t, i) => (p(), h("div", _e, [
671
- f("button", {
751
+ return (t, c) => (d(), v("div", De, [
752
+ i("button", {
672
753
  class: "tl-flex tl-items-center tl-justify-between tl-w-full tl-py-2 tl-px-4 tl-bg-gray-100 tl-border-none tl-text-gray-400 tl-font-bold tl-text-xs tl-font-sans tl-cursor-pointer",
673
754
  "aria-expanded": l.value,
674
755
  "aria-haspopup": "true",
675
756
  role: "button",
676
757
  "data-folder": t.label,
677
758
  tabindex: "0",
678
- onClick: n
759
+ onClick: o
679
760
  }, [
680
- f("span", null, F(t.label), 1),
681
- f("i", {
682
- class: M(l.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
761
+ i("span", null, M(t.label), 1),
762
+ i("i", {
763
+ class: C(l.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
683
764
  }, null, 2)
684
- ], 8, we),
685
- X(wt, {
765
+ ], 8, Ke),
766
+ F(ft, {
686
767
  name: "slide",
687
768
  "enter-active-class": "tl-animate-fade-in tl-animate-duration-200 tl-animate-ease-in-out",
688
769
  "leave-active-class": "tl-animate-fade-out tl-animate-duration-200 tl-animate-ease-in-out"
689
770
  }, {
690
- default: ut(() => [
691
- ct(f("div", xe, [
692
- (p(!0), h(V, null, j(t.controls, (r) => (p(), C(bt, {
693
- key: r.label,
694
- control: r,
771
+ default: R(() => [
772
+ Q(i("div", Pe, [
773
+ (d(!0), v(K, null, B(t.controls, (a) => (d(), I(xt, {
774
+ key: a.label,
775
+ control: a,
695
776
  role: "menuitem",
696
- onChange: (c) => o(c, r)
777
+ onChange: (s) => n(s, a)
697
778
  }, null, 8, ["control", "onChange"]))), 128))
698
779
  ], 512), [
699
- [it, l.value]
780
+ [Z, l.value]
700
781
  ])
701
782
  ]),
702
783
  _: 1
703
784
  })
704
785
  ]));
705
786
  }
706
- }), ke = {
787
+ }), Ue = { class: "tl-relative tl-px-4 tl-py-6 tl-grid tl-grid-cols-2 tl-border tl-border-solid tl-border-gray-300 tl-rounded tl-my-4" }, Oe = { class: "tl-absolute tl-bg-white tl-text-gray-400 tl-px-2 tl-rounded -tl-top-2 tl-left-2" }, ot = /* @__PURE__ */ w({
788
+ __name: "Pane",
789
+ props: {
790
+ title: {}
791
+ },
792
+ setup(e) {
793
+ return (n, l) => (d(), v("div", Ue, [
794
+ i("span", Oe, M(n.title), 1),
795
+ mt(n.$slots, "default")
796
+ ]));
797
+ }
798
+ }), Be = { class: "" }, Le = ["onClick"], ze = { class: "tl-cursor-pointer tl-flex tl-items-center" }, Re = { class: "tl-mr-2 tl-py-2" }, qe = /* @__PURE__ */ i("path", {
799
+ "stroke-linecap": "round",
800
+ "stroke-linejoin": "round",
801
+ "stroke-width": "2",
802
+ d: "M9 5l7 7-7 7"
803
+ }, null, -1), Ne = [
804
+ qe
805
+ ], Xe = { class: "tl-border-l-2 tl-border-transparent tl-border-l-gray-200 tl-border-2 tl-border-solid tl-ml-2 tl-pl-4" }, wt = /* @__PURE__ */ w({
806
+ __name: "Tree",
807
+ props: {
808
+ items: {},
809
+ depth: { default: 0 }
810
+ },
811
+ setup(e) {
812
+ const n = e, l = P(() => {
813
+ var t;
814
+ return (t = n.items) == null ? void 0 : t.map((c) => V({
815
+ ...c,
816
+ isOpen: !1
817
+ }));
818
+ });
819
+ function o(t) {
820
+ t.isOpen = !t.isOpen;
821
+ }
822
+ return (t, c) => (d(), v("div", Be, [
823
+ i("ul", {
824
+ class: C(["tl-list-none", { "tl-pl-0": t.depth === 0 }]),
825
+ "V-IF": ""
826
+ }, [
827
+ (d(!0), v(K, null, B(l.value, (a, s) => (d(), v("li", {
828
+ key: s,
829
+ onClick: (f) => o(a)
830
+ }, [
831
+ i("div", ze, [
832
+ i("span", Re, [
833
+ (d(), v("svg", {
834
+ class: C([a.isOpen ? "tl-transform tl-rotate-90" : "", "tl-w-4 tl-h-4 tl-transition-transform tl-text-gray-300"]),
835
+ xmlns: "http://www.w3.org/2000/svg",
836
+ fill: "none",
837
+ viewBox: "0 0 24 24",
838
+ stroke: "currentColor"
839
+ }, Ne, 2))
840
+ ]),
841
+ J(" " + M(a.name), 1)
842
+ ]),
843
+ Q(i("div", Xe, [
844
+ mt(t.$slots, `depth-${t.depth}`, { item: a }, () => [
845
+ F(wt, {
846
+ items: a.children,
847
+ depth: t.depth + 1
848
+ }, null, 8, ["items", "depth"])
849
+ ])
850
+ ], 512), [
851
+ [Z, a.isOpen]
852
+ ])
853
+ ], 8, Le))), 128))
854
+ ], 2)
855
+ ]));
856
+ }
857
+ }), Ye = { class: "tl-mb-4" }, We = ["aria-expanded"], je = /* @__PURE__ */ i("span", null, [
858
+ /* @__PURE__ */ i("i", { class: "i-iconoir-dashboard-speed" }),
859
+ /* @__PURE__ */ J(" Performance ")
860
+ ], -1), Ge = {
861
+ class: "tl-bg-white tl-rounded-b tl-pt-4",
862
+ role: "menu"
863
+ }, He = { class: "tl-p-2" }, Je = { class: "tl-flex tl-items-center tl-mb-2" }, Qe = { class: "tl-bg-gray-200 tl-text-gray-600 tl-rounded tl-p-1 tl-flex tl-w-4 tl-mr-1" }, Ze = { class: "tl-ml-2 tl-font-bold tl-text" }, tl = { class: "tl-text-xs tl-text-gray-500" }, el = { class: "tl-flex tl-items-center tl-mb-2" }, ll = { class: "tl-bg-gray-200 tl-text-gray-600 tl-rounded tl-p-1 tl-flex tl-w-4 tl-mr-1" }, ol = { class: "tl-ml-2 tl-font-bold tl-text" }, nl = { class: "tl-text-xs tl-text-gray-500" }, rl = { class: "tl-w-full tl-overflow tl-text-xxs" }, al = /* @__PURE__ */ w({
864
+ __name: "index",
865
+ props: {
866
+ uuid: {}
867
+ },
868
+ setup(e) {
869
+ const n = e, { uuid: l } = q(n), { gl: o, memory: t } = ct(l == null ? void 0 : l.value), c = [{
870
+ label: "geometries",
871
+ icon: "i-iconoir-box-3d-three-points"
872
+ }, {
873
+ label: "textures",
874
+ icon: "i-iconoir-select-face-3d"
875
+ }], a = [{
876
+ label: "calls",
877
+ icon: "i-iconoir-comp-align-left"
878
+ }, {
879
+ label: "triangles",
880
+ icon: "i-iconoir-triangle"
881
+ }, {
882
+ label: "points",
883
+ icon: "i-iconoir-one-point-circle"
884
+ }, {
885
+ label: "lines",
886
+ icon: "i-iconoir-linear"
887
+ }], s = V({
888
+ geometries: 0,
889
+ textures: 0,
890
+ calls: 0,
891
+ triangles: 0,
892
+ points: 0,
893
+ lines: 0,
894
+ programs: []
895
+ });
896
+ bt(() => {
897
+ o && (s.geometries = o.info.memory.geometries, s.textures = o.info.memory.textures, s.calls = o.info.render.calls, s.triangles = o.info.render.triangles, s.points = o.info.render.points, s.lines = o.info.render.lines, s.programs = o.info.programs);
898
+ });
899
+ const f = b(!1), y = () => {
900
+ f.value = !f.value;
901
+ }, g = P(() => s.programs.map((u) => ({
902
+ ...u,
903
+ name: u.type,
904
+ uniforms: u.getUniforms()
905
+ })));
906
+ return (u, r) => (d(), v("div", Ye, [
907
+ i("button", {
908
+ class: "tl-flex tl-items-center tl-justify-between tl-w-full tl-py-2 tl-px-4 tl-bg-gray-100 tl-border-none tl-text-gray-400 tl-font-bold tl-text-xs tl-font-sans tl-cursor-pointer",
909
+ "aria-expanded": f.value,
910
+ "aria-haspopup": "true",
911
+ role: "button",
912
+ tabindex: "0",
913
+ onClick: y
914
+ }, [
915
+ je,
916
+ i("i", {
917
+ class: C(f.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
918
+ }, null, 2)
919
+ ], 8, We),
920
+ F(ft, {
921
+ name: "slide",
922
+ "enter-active-class": "tl-animate-fade-in tl-animate-duration-200 tl-animate-ease-in-out",
923
+ "leave-active-class": "tl-animate-fade-out tl-animate-duration-200 tl-animate-ease-in-out"
924
+ }, {
925
+ default: R(() => [
926
+ Q(i("div", Ge, [
927
+ i("div", He, [
928
+ F(ot, {
929
+ title: `Memory ${k(qt)(k(t).allocatedMem)}KB`
930
+ }, {
931
+ default: R(() => [
932
+ (d(), v(K, null, B(c, (p) => i("div", {
933
+ key: p,
934
+ class: "tl-flex tl-flex-col tl-items-center"
935
+ }, [
936
+ i("div", Je, [
937
+ i("span", Qe, [
938
+ i("i", {
939
+ class: C(["tl-pl tl-text-sm", p.icon])
940
+ }, null, 2)
941
+ ]),
942
+ i("span", Ze, M(s[p.label]), 1)
943
+ ]),
944
+ i("span", tl, M(p.label), 1)
945
+ ])), 64))
946
+ ]),
947
+ _: 1
948
+ }, 8, ["title"]),
949
+ F(_t, {
950
+ points: k(t).accumulator,
951
+ value: k(t).currentMem,
952
+ unit: "MB",
953
+ label: "memory"
954
+ }, null, 8, ["points", "value"]),
955
+ F(ot, { title: "Render" }, {
956
+ default: R(() => [
957
+ (d(), v(K, null, B(a, (p) => i("div", {
958
+ key: p,
959
+ class: "tl-flex tl-flex-col tl-items-center tl-mb-2"
960
+ }, [
961
+ i("div", el, [
962
+ i("span", ll, [
963
+ i("i", {
964
+ class: C(["tl-pl tl-text-sm", p.icon])
965
+ }, null, 2)
966
+ ]),
967
+ i("span", ol, M(s[p.label]), 1)
968
+ ]),
969
+ i("span", nl, M(p.label), 1)
970
+ ])), 64))
971
+ ]),
972
+ _: 1
973
+ }),
974
+ F(ot, { title: "Programs" }, {
975
+ default: R(() => [
976
+ F(wt, { items: g.value }, {
977
+ "depth-0": R(({ item: p }) => [
978
+ i("pre", rl, M(p), 1)
979
+ ]),
980
+ _: 1
981
+ }, 8, ["items"])
982
+ ]),
983
+ _: 1
984
+ })
985
+ ])
986
+ ], 512), [
987
+ [Z, f.value]
988
+ ])
989
+ ]),
990
+ _: 1
991
+ })
992
+ ]));
993
+ }
994
+ }), sl = {
707
995
  tabindex: "0",
708
996
  class: "tl-bg-white tl-shadow-xl tl-rounded tl-border-4 tl-border-solid tl-border-black"
709
- }, Ce = /* @__PURE__ */ f("i", { class: "tl-h-4 tl-w-4 tl-p-1.5 tl-flex tl-items-center tl-line-height-0 tl-rounded-full tl-bg-gray-100 tl-text-xs" }, "🍰", -1), Me = /* @__PURE__ */ f("div", null, [
710
- /* @__PURE__ */ f("i", { class: "i-ic-baseline-drag-indicator" }),
711
- /* @__PURE__ */ f("i", { class: "i-ic-baseline-drag-indicator" }),
712
- /* @__PURE__ */ f("i", { class: "i-ic-baseline-drag-indicator" })
713
- ], -1), Se = /* @__PURE__ */ f("div", null, null, -1), Te = [
714
- Ce,
715
- Me,
716
- Se
717
- ], Ae = 280, Fe = /* @__PURE__ */ k({
997
+ }, il = /* @__PURE__ */ i("i", { class: "tl-h-4 tl-w-4 tl-p-1.5 tl-flex tl-items-center tl-line-height-0 tl-rounded-full tl-bg-gray-100 tl-text-xs" }, "🍰", -1), cl = /* @__PURE__ */ i("div", null, [
998
+ /* @__PURE__ */ i("i", { class: "i-ic-baseline-drag-indicator" }),
999
+ /* @__PURE__ */ i("i", { class: "i-ic-baseline-drag-indicator" }),
1000
+ /* @__PURE__ */ i("i", { class: "i-ic-baseline-drag-indicator" })
1001
+ ], -1), ul = /* @__PURE__ */ i("div", null, null, -1), dl = [
1002
+ il,
1003
+ cl,
1004
+ ul
1005
+ ], pl = 280, gl = /* @__PURE__ */ w({
718
1006
  __name: "TresLeches",
719
1007
  props: {
720
1008
  uuid: {}
721
1009
  },
722
1010
  setup(e) {
723
- const o = e, { uuid: l } = B(o), { width: n } = pt(), t = d(null), i = Dt(l == null ? void 0 : l.value);
724
- function r(u, _) {
725
- i[K(u)].value = _, i[K(u)][K(u)] = _;
1011
+ const n = e, { uuid: l } = q(n), { width: o } = vt(), t = b(null), c = Lt(l == null ? void 0 : l.value), a = ct(l == null ? void 0 : l.value);
1012
+ function s(y, g) {
1013
+ c[k(y)].value = g, c[k(y)][k(y)] = g;
726
1014
  }
727
- const c = z(() => {
728
- const u = {};
729
- for (const _ in i) {
730
- const y = i[_], s = y.folder || "default";
731
- u[s] || (u[s] = []), u[s].push(y);
1015
+ const f = P(() => {
1016
+ const y = {};
1017
+ for (const g in c) {
1018
+ const u = c[g], r = u.folder || "default";
1019
+ y[r] || (y[r] = []), y[r].push(u);
732
1020
  }
733
- return u;
1021
+ return y;
734
1022
  });
735
- return (u, _) => (p(), C(K(It), {
736
- id: K(l),
737
- "initial-value": { x: K(n) - Ae - 40, y: 10 },
738
- class: M(["tl-absolute tl-select-none tl-z-24 tl-w-280px tl-font-sans tl-text-xs", u.$attrs.class]),
1023
+ return (y, g) => (d(), I(k(Ot), {
1024
+ id: k(l),
1025
+ "initial-value": { x: k(o) - pl - 40, y: 10 },
1026
+ class: C(["tl-absolute tl-select-none tl-z-24 tl-w-280px tl-font-sans tl-text-xs", y.$attrs.class]),
739
1027
  handle: t.value
740
1028
  }, {
741
- default: ut(() => [
742
- f("div", ke, [
743
- f("header", {
1029
+ default: R(() => [
1030
+ i("div", sl, [
1031
+ i("header", {
744
1032
  ref_key: "handle",
745
1033
  ref: t,
746
1034
  class: "tl-relative tl-cursor-grabbing tl-p-4 tl-flex tl-justify-between tl-text-gray-200 tl-relative"
747
- }, Te, 512),
748
- (p(!0), h(V, null, j(c.value, (y, s) => (p(), h(V, { key: s }, [
749
- s !== "default" ? (p(), C($e, {
1035
+ }, dl, 512),
1036
+ (d(!0), v(K, null, B(f.value, (u, r) => (d(), v(K, { key: r }, [
1037
+ r !== "default" ? (d(), I(Ve, {
750
1038
  key: 0,
751
- label: s,
752
- controls: y
753
- }, null, 8, ["label", "controls"])) : H("", !0),
754
- s === "default" ? (p(!0), h(V, { key: 1 }, j(y, (a) => (p(), C(bt, {
755
- key: a.label,
756
- control: a,
757
- onChange: (m) => r(a.key, m)
758
- }, null, 8, ["control", "onChange"]))), 128)) : H("", !0)
759
- ], 64))), 128))
1039
+ label: r,
1040
+ controls: u
1041
+ }, null, 8, ["label", "controls"])) : W("", !0),
1042
+ r === "default" ? (d(!0), v(K, { key: 1 }, B(u, (p) => (d(), I(xt, {
1043
+ key: p.label,
1044
+ control: p,
1045
+ onChange: (E) => s(p.key, E)
1046
+ }, null, 8, ["control", "onChange"]))), 128)) : W("", !0)
1047
+ ], 64))), 128)),
1048
+ k(a).gl ? (d(), I(al, {
1049
+ key: 0,
1050
+ uuid: k(l)
1051
+ }, null, 8, ["uuid"])) : W("", !0)
760
1052
  ])
761
1053
  ]),
762
1054
  _: 1
763
1055
  }, 8, ["id", "initial-value", "class", "handle"]));
764
1056
  }
1057
+ }), yl = /* @__PURE__ */ w({
1058
+ __name: "TresPerf",
1059
+ setup(e) {
1060
+ return Xt(), (n, l) => (d(), v("div"));
1061
+ }
765
1062
  });
766
1063
  export {
767
- Fe as TresLeches,
768
- De as useControls,
769
- Dt as useControlsProvider
1064
+ yl as Perf,
1065
+ gl as TresLeches,
1066
+ bl as useControls,
1067
+ Lt as useControlsProvider,
1068
+ Xt as usePerf
770
1069
  };