@soonspacejs/plugin-flow 2.16.8 → 3.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,8 +1,7 @@
1
- import { Vector3 as I, Euler as D, EventDispatcher as z } from "three";
1
+ import { Vector3 as I, Euler as D, EventDispatcher as G } from "three";
2
2
  import T from "soonspacejs";
3
- import { AnimationPlayer as k } from "umanager-animation-parser";
4
- import { InteractionType as L, InteractionObsType as j, FlowParser as Y, InteractionAction as $ } from "@soonspacejs/plugin-flow";
5
- class K {
3
+ import { InteractionType as x, InteractionObsType as U, FlowParser as rt, InteractionAction as lt } from "@soonspacejs/plugin-flow";
4
+ class ht {
6
5
  id;
7
6
  source;
8
7
  target;
@@ -12,8 +11,8 @@ class K {
12
11
  }
13
12
  }
14
13
  var n = /* @__PURE__ */ ((e) => (e.LOCAL = "LOCAL", e.READ_CTX = "READ_CTX", e.WRITE_CTX = "WRITE_CTX", e))(n || {}), r = /* @__PURE__ */ ((e) => (e.START = "START", e.COLOR = "COLOR", e.NUMBER = "NUMBER", e.HIGHLIGHT = "HIGHLIGHT", e.UN_HIGHLIGHT = "UN_HIGHLIGHT", e.OPACITY = "OPACITY", e.UN_OPACITY = "UN_OPACITY", e.EMISSIVE = "EMISSIVE", e.UN_EMISSIVE = "UN_EMISSIVE", e.MESH = "MESH", e.MESHES = "MESHES", e.MODEL = "MODEL", e.MODELS = "MODELS", e.SHOW = "SHOW", e.HIDE = "HIDE", e.CLIP_ANIMATION = "CLIP_ANIMATION", e.UN_CLIP_ANIMATION = "UN_CLIP_ANIMATION", e.TWEEN_ANIMATION = "TWEEN_ANIMATION", e.UN_TWEEN_ANIMATION = "UN_TWEEN_ANIMATION", e.COMPONENT_TWEEN_ANIMATION = "COMPONENT_TWEEN_ANIMATION", e.UN_COMPONENT_TWEEN_ANIMATION = "UN_COMPONENT_TWEEN_ANIMATION", e.SPACE = "SPACE", e.SPACES = "SPACES", e.PATH = "PATH", e.PATHS = "PATHS", e.POI = "POI", e.POIS = "POIS", e.FLY_TO = "FLY_TO", e.TRANSLATE = "TRANSLATE", e.ROTATE = "ROTATE", e.SCALE = "SCALE", e.DATA_FILTER = "DATA_FILTER", e.DATA_EXTRACTION = "DATA_EXTRACTION", e.CONDITION_NODE = "CONDITION_NODE", e.DELAY = "DELAY", e.USER_DATA_NODE = "USER_DATA_NODE", e))(r || {});
15
- let J = 0;
16
- const q = [
14
+ let ut = 0;
15
+ const dt = [
17
16
  r.MESH,
18
17
  r.MESHES,
19
18
  r.MODEL,
@@ -32,7 +31,7 @@ const q = [
32
31
  r.CONDITION_NODE,
33
32
  r.START
34
33
  ];
35
- class f {
34
+ class A {
36
35
  parser;
37
36
  ssp;
38
37
  id;
@@ -113,7 +112,7 @@ class f {
113
112
  if (await this.waitForPrevNodes(), this.rejected) throw new Error();
114
113
  this.mergeContext(), await (this.onBefore ?? this.parser.onNodeBefore)?.(this);
115
114
  try {
116
- (!i || q.includes(this.type)) && (this.execOrder = ++J, await this.exec(t));
115
+ (!i || dt.includes(this.type)) && (this.execOrder = ++ut, await this.exec(t));
117
116
  } catch (o) {
118
117
  throw this.reject(o), o;
119
118
  }
@@ -131,7 +130,7 @@ class f {
131
130
  return this.readContext(l(t.value));
132
131
  if (t.type === n.LOCAL) {
133
132
  const { viewport: { scene: i } } = this.ssp;
134
- return t.name === "objects" || t.name === "models" || t.name === "meshs" ? l(t.value).map((o) => E(this.ssp, o, s ?? i)) : t.name === "object" || t.name === "model" || t.name === "mesh" ? E(this.ssp, l(t.value), s ?? i) : l(t.value);
133
+ return t.name === "objects" || t.name === "models" || t.name === "meshs" ? l(t.value).map((o) => w(this.ssp, o, s ?? i)) : t.name === "object" || t.name === "model" || t.name === "mesh" ? w(this.ssp, l(t.value), s ?? i) : l(t.value);
135
134
  }
136
135
  }
137
136
  _mergeUserDataMap() {
@@ -144,12 +143,12 @@ class f {
144
143
  });
145
144
  }
146
145
  }
147
- class Z extends f {
146
+ class pt extends A {
148
147
  constructor(t, s) {
149
148
  super(t, s);
150
149
  }
151
150
  }
152
- class Q extends f {
151
+ class ft extends A {
153
152
  constructor(t, s) {
154
153
  super(t, s);
155
154
  }
@@ -158,7 +157,7 @@ class Q extends f {
158
157
  t && s && this.writeContext(l(s.value), l(t.value));
159
158
  }
160
159
  }
161
- class tt extends f {
160
+ class Ct extends A {
162
161
  constructor(t, s) {
163
162
  super(t, s);
164
163
  }
@@ -167,8 +166,8 @@ class tt extends f {
167
166
  t && s && this.writeContext(l(s.value), l(t.value));
168
167
  }
169
168
  }
170
- const { objectHandle: ss } = T.utils;
171
- class st extends f {
169
+ const { objectHandle: As } = T.utils;
170
+ class At extends A {
172
171
  constructor(t, s) {
173
172
  super(t, s);
174
173
  }
@@ -184,21 +183,21 @@ class st extends f {
184
183
  async exec(t) {
185
184
  const s = this.findProp("objects", [n.READ_CTX, n.LOCAL]), i = this.findProp("color", [n.READ_CTX, n.LOCAL]), o = this.findProp("opacity", [n.READ_CTX, n.LOCAL]), a = await t.getTarget?.(this);
186
185
  if (s && i && o) {
187
- const c = this.getValue(s, a), h = this.getValue(i), u = this.getValue(o);
188
- c && (this.ssp.highlightShow(c, { color: h, opacity: u }), this.cleanSets.add(() => {
186
+ const c = this.getValue(s, a), h = this.getValue(i), d = this.getValue(o);
187
+ c && (this.ssp.highlightShow(c, { color: h, opacity: d }), this.cleanSets.add(() => {
189
188
  this.ssp.unHighlightShow(c);
190
189
  }));
191
190
  }
192
191
  }
193
192
  }
194
- const { objectHandle: et } = T.utils;
195
- class it extends f {
193
+ const { objectHandle: gt } = T.utils;
194
+ class Ot extends A {
196
195
  constructor(t, s) {
197
196
  super(t, s);
198
197
  }
199
198
  filterUnHighlightObject(t) {
200
199
  const s = [];
201
- return et(t, (i) => {
200
+ return gt(t, (i) => {
202
201
  this.ssp.viewport.scener.selectedObjects.highlight.has(i) && s.push(i);
203
202
  }), s;
204
203
  }
@@ -213,8 +212,8 @@ class it extends f {
213
212
  }
214
213
  }
215
214
  }
216
- const { objectHandle: ot } = T.utils;
217
- class nt extends f {
215
+ const { objectHandle: Pt } = T.utils;
216
+ class Tt extends A {
218
217
  constructor(t, s) {
219
218
  super(t, s);
220
219
  }
@@ -230,24 +229,24 @@ class nt extends f {
230
229
  async exec(t) {
231
230
  const s = this.findProp("objects", [n.READ_CTX, n.LOCAL]), i = this.findProp("color", [n.READ_CTX, n.LOCAL]), o = this.findProp("opacity", [n.READ_CTX, n.LOCAL]), a = await t.getTarget?.(this);
232
231
  if (s && i && o) {
233
- const c = this.getValue(s, a), h = this.getValue(i), u = this.getValue(o);
232
+ const c = this.getValue(s, a), h = this.getValue(i), d = this.getValue(o);
234
233
  if (c) {
235
- const C = ot(c, (d) => d);
236
- this.ssp.opacityShow(C, { color: h, opacity: u }), this.cleanSets.add(() => {
237
- this.ssp.unOpacityShow(C);
234
+ const u = Pt(c, (p) => p);
235
+ this.ssp.opacityShow(u, { color: h, opacity: d }), this.cleanSets.add(() => {
236
+ this.ssp.unOpacityShow(u);
238
237
  });
239
238
  }
240
239
  }
241
240
  }
242
241
  }
243
- const { objectHandle: at } = T.utils;
244
- class ct extends f {
242
+ const { objectHandle: wt } = T.utils;
243
+ class Et extends A {
245
244
  constructor(t, s) {
246
245
  super(t, s);
247
246
  }
248
247
  filterUnOpacityObject(t) {
249
248
  const s = [];
250
- return at(t, (i) => {
249
+ return wt(t, (i) => {
251
250
  this.ssp.viewport.scener.selectedObjects.opacity.has(i) && s.push(i);
252
251
  }), s;
253
252
  }
@@ -262,8 +261,8 @@ class ct extends f {
262
261
  }
263
262
  }
264
263
  }
265
- const { objectHandle: es } = T.utils;
266
- class rt extends f {
264
+ const { objectHandle: gs } = T.utils;
265
+ class Lt extends A {
267
266
  constructor(t, s) {
268
267
  super(t, s);
269
268
  }
@@ -277,29 +276,29 @@ class rt extends f {
277
276
  // return objects
278
277
  // }
279
278
  async exec(t) {
280
- const s = this.findProp("objects", [n.READ_CTX, n.LOCAL]), i = this.findProp("color", [n.READ_CTX, n.LOCAL]), o = this.findProp("baseColor", [n.READ_CTX, n.LOCAL]), a = this.findProp("minOpacity", [n.READ_CTX, n.LOCAL]), c = this.findProp("maxOpacity", [n.READ_CTX, n.LOCAL]), h = this.findProp("duration", [n.READ_CTX, n.LOCAL]), u = await t.getTarget?.(this);
279
+ const s = this.findProp("objects", [n.READ_CTX, n.LOCAL]), i = this.findProp("color", [n.READ_CTX, n.LOCAL]), o = this.findProp("baseColor", [n.READ_CTX, n.LOCAL]), a = this.findProp("minOpacity", [n.READ_CTX, n.LOCAL]), c = this.findProp("maxOpacity", [n.READ_CTX, n.LOCAL]), h = this.findProp("duration", [n.READ_CTX, n.LOCAL]), d = await t.getTarget?.(this);
281
280
  if (s && i && o && a && c && h) {
282
- const C = this.getValue(s, u), d = this.getValue(i), P = this.getValue(o), x = this.getValue(a), p = this.getValue(c), A = this.getValue(h);
283
- C && (this.ssp.emissiveShow(C, {
284
- color: d,
281
+ const u = this.getValue(s, d), p = this.getValue(i), P = this.getValue(o), E = this.getValue(a), f = this.getValue(c), C = this.getValue(h);
282
+ u && (this.ssp.emissiveShow(u, {
283
+ color: p,
285
284
  baseColor: P,
286
- minOpacity: x,
287
- maxOpacity: p,
288
- duration: A
285
+ minOpacity: E,
286
+ maxOpacity: f,
287
+ duration: C
289
288
  }), this.cleanSets.add(() => {
290
- this.ssp.unEmissiveShow(C);
289
+ this.ssp.unEmissiveShow(u);
291
290
  }));
292
291
  }
293
292
  }
294
293
  }
295
- const { objectHandle: lt } = T.utils;
296
- class ht extends f {
294
+ const { objectHandle: mt } = T.utils;
295
+ class xt extends A {
297
296
  constructor(t, s) {
298
297
  super(t, s);
299
298
  }
300
299
  filterUnEmissiveObject(t) {
301
300
  const s = [];
302
- return lt(t, (i) => {
301
+ return mt(t, (i) => {
303
302
  this.ssp.viewport.scener.selectedObjects.emissive.has(i) && s.push(i);
304
303
  }), s;
305
304
  }
@@ -314,51 +313,51 @@ class ht extends f {
314
313
  }
315
314
  }
316
315
  }
317
- const y = /* @__PURE__ */ Symbol("meshCache");
318
- class ut extends f {
316
+ const M = /* @__PURE__ */ Symbol("meshCache");
317
+ class It extends A {
319
318
  constructor(t, s) {
320
319
  super(t, s);
321
320
  }
322
321
  async exec(t) {
323
322
  const { viewport: { scene: s } } = this.ssp, i = await t.getTarget?.(this) || s;
324
- t[y] || (t[y] = {});
323
+ t[M] || (t[M] = {});
325
324
  const o = this.findProp("mesh", n.LOCAL), a = this.findProp("out", n.WRITE_CTX);
326
325
  if (o && a) {
327
326
  let c = null;
328
- const h = l(o.value), u = l(a.value), C = t[y][h];
329
- if (C) {
330
- c = C;
327
+ const h = l(o.value), d = l(a.value), u = t[M][h];
328
+ if (u) {
329
+ c = u;
331
330
  return;
332
331
  }
333
- const d = _(i, h);
334
- d && (c = d, t[y][h] = d), this.writeContext(u, c);
332
+ const p = y(i, h);
333
+ p && (c = p, t[M][h] = p), this.writeContext(d, c);
335
334
  }
336
335
  }
337
336
  }
338
- const M = /* @__PURE__ */ Symbol("meshesCache");
339
- class dt extends f {
337
+ const S = /* @__PURE__ */ Symbol("meshesCache");
338
+ class bt extends A {
340
339
  constructor(t, s) {
341
340
  super(t, s);
342
341
  }
343
342
  async exec(t) {
344
343
  const { viewport: { scene: s } } = this.ssp, i = await t.getTarget?.(this) || s;
345
- t[M] || (t[M] = {});
344
+ t[S] || (t[S] = {});
346
345
  const o = this.findProp("meshes", n.LOCAL), a = this.findProp("out", n.WRITE_CTX);
347
346
  if (o && a) {
348
- const c = [], h = l(o.value), u = l(a.value);
349
- h.forEach((C) => {
350
- const d = t[M][C];
351
- if (d) {
352
- c.push(d);
347
+ const c = [], h = l(o.value), d = l(a.value);
348
+ h.forEach((u) => {
349
+ const p = t[S][u];
350
+ if (p) {
351
+ c.push(p);
353
352
  return;
354
353
  }
355
- const P = _(i, C);
356
- P && (c.push(P), t[M][C] = P);
357
- }), this.writeContext(u, c);
354
+ const P = y(i, u);
355
+ P && (c.push(P), t[S][u] = P);
356
+ }), this.writeContext(d, c);
358
357
  }
359
358
  }
360
359
  }
361
- class pt extends f {
360
+ class Nt extends A {
362
361
  constructor(t, s) {
363
362
  super(t, s);
364
363
  }
@@ -366,11 +365,11 @@ class pt extends f {
366
365
  const t = this.findProp("model", n.LOCAL), s = this.findProp("out", n.WRITE_CTX);
367
366
  if (t && s) {
368
367
  const i = l(t.value), o = l(s.value);
369
- this.writeContext(o, E(this.ssp, i));
368
+ this.writeContext(o, w(this.ssp, i));
370
369
  }
371
370
  }
372
371
  }
373
- class ft extends f {
372
+ class _t extends A {
374
373
  constructor(t, s) {
375
374
  super(t, s);
376
375
  }
@@ -378,11 +377,11 @@ class ft extends f {
378
377
  const t = this.findProp("models", n.LOCAL), s = this.findProp("out", n.WRITE_CTX);
379
378
  if (t && s) {
380
379
  const i = l(t.value), o = l(s.value);
381
- this.writeContext(o, kt(this.ssp, i));
380
+ this.writeContext(o, is(this.ssp, i));
382
381
  }
383
382
  }
384
383
  }
385
- class Ct extends f {
384
+ class yt extends A {
386
385
  constructor(t, s) {
387
386
  super(t, s);
388
387
  }
@@ -394,7 +393,7 @@ class Ct extends f {
394
393
  }
395
394
  }
396
395
  }
397
- class At extends f {
396
+ class Mt extends A {
398
397
  constructor(t, s) {
399
398
  super(t, s);
400
399
  }
@@ -409,22 +408,22 @@ class At extends f {
409
408
  try {
410
409
  if (this.execFn(o.value) !== !0) throw new Error();
411
410
  } catch {
412
- const c = i.find((u) => u.sourceHandle == String(o.id));
411
+ const c = i.find((d) => d.sourceHandle == String(o.id));
413
412
  if (!c) return;
414
- this.postNodes.find((u) => u.id === c.target)?.reject();
413
+ this.postNodes.find((d) => d.id === c.target)?.reject();
415
414
  }
416
415
  });
417
416
  }
418
417
  }
419
418
  }
420
- const { objectHandle: X } = T.utils;
421
- class Ot extends f {
419
+ const { objectHandle: k } = T.utils;
420
+ class St extends A {
422
421
  constructor(t, s) {
423
422
  super(t, s);
424
423
  }
425
424
  filterShowObject(t) {
426
425
  const s = [];
427
- return X(t, (i) => {
426
+ return k(t, (i) => {
428
427
  i.visible === !1 && s.push(i);
429
428
  }), s;
430
429
  }
@@ -434,8 +433,8 @@ class Ot extends f {
434
433
  const o = this.getValue(s, i);
435
434
  if (o) {
436
435
  const a = this.filterShowObject(o), c = (h) => {
437
- X(a, (u) => {
438
- u.visible = h;
436
+ k(a, (d) => {
437
+ d.visible = h;
439
438
  }), this.ssp.render();
440
439
  };
441
440
  c(!0), this.cleanSets.add(() => c(!1));
@@ -443,14 +442,14 @@ class Ot extends f {
443
442
  }
444
443
  }
445
444
  }
446
- const { objectHandle: U } = T.utils;
447
- class gt extends f {
445
+ const { objectHandle: B } = T.utils;
446
+ class Dt extends A {
448
447
  constructor(t, s) {
449
448
  super(t, s);
450
449
  }
451
450
  filterHideObject(t) {
452
451
  const s = [];
453
- return U(t, (i) => {
452
+ return B(t, (i) => {
454
453
  i.visible === !0 && s.push(i);
455
454
  }), s;
456
455
  }
@@ -460,8 +459,8 @@ class gt extends f {
460
459
  const o = this.getValue(s, i);
461
460
  if (o) {
462
461
  const a = this.filterHideObject(o), c = (h) => {
463
- U(a, (u) => {
464
- u.visible = h;
462
+ B(a, (d) => {
463
+ d.visible = h;
465
464
  }), this.ssp.render();
466
465
  };
467
466
  c(!1), this.cleanSets.add(() => c(!0));
@@ -469,106 +468,106 @@ class gt extends f {
469
468
  }
470
469
  }
471
470
  }
472
- const { objectHandle: S } = T.utils;
473
- class Pt extends f {
471
+ const { objectHandle: v } = T.utils;
472
+ class vt extends A {
474
473
  constructor(t, s) {
475
474
  super(t, s);
476
475
  }
477
476
  async exec(t) {
478
477
  const s = this.findProp("objects", [n.READ_CTX, n.LOCAL]), i = this.findProp("axis", [n.READ_CTX, n.LOCAL]), o = this.findProp("translate", [n.READ_CTX, n.LOCAL]), a = await t.getTarget?.(this);
479
478
  if (s && i && o) {
480
- const c = this.getValue(s, a), h = this.getValue(i), u = this.getValue(o);
479
+ const c = this.getValue(s, a), h = this.getValue(i), d = this.getValue(o);
481
480
  if (c) {
482
- const C = [];
483
- S(c, (p) => {
484
- C.push(p.position.clone());
481
+ const u = [];
482
+ v(c, (f) => {
483
+ u.push(f.position.clone());
485
484
  });
486
- const P = (p, A) => {
485
+ const P = (f, C) => {
487
486
  switch (h) {
488
487
  case "x":
489
- p.setX(A.x);
488
+ f.setX(C.x);
490
489
  break;
491
490
  case "y":
492
- p.setY(A.y);
491
+ f.setY(C.y);
493
492
  break;
494
493
  case "z":
495
- p.setZ(A.z);
494
+ f.setZ(C.z);
496
495
  break;
497
496
  }
498
497
  };
499
498
  await (async () => {
500
- const p = S(c, async (A) => {
501
- const O = A.position.clone();
499
+ const f = v(c, async (C) => {
500
+ const g = C.position.clone();
502
501
  switch (h) {
503
502
  case "x":
504
- await this.ssp.animation(O, new I().set(O.x + u, O.y, O.z), { duration: 800 }, (g) => P(A.position, g));
503
+ await this.ssp.animation(g, new I().set(g.x + d, g.y, g.z), { duration: 800 }, (O) => P(C.position, O));
505
504
  break;
506
505
  case "y":
507
- await this.ssp.animation(O, new I().set(O.x, O.y + u, O.z), { duration: 800 }, (g) => P(A.position, g));
506
+ await this.ssp.animation(g, new I().set(g.x, g.y + d, g.z), { duration: 800 }, (O) => P(C.position, O));
508
507
  break;
509
508
  case "z":
510
- await this.ssp.animation(O, new I().set(O.x, O.y, O.z + u), { duration: 800 }, (g) => P(A.position, g));
509
+ await this.ssp.animation(g, new I().set(g.x, g.y, g.z + d), { duration: 800 }, (O) => P(C.position, O));
511
510
  break;
512
511
  }
513
512
  });
514
- p instanceof Array ? await Promise.all(p) : await p, this.ssp.render();
513
+ f instanceof Array ? await Promise.all(f) : await f, this.ssp.render();
515
514
  })(), this.cleanSets.add(() => {
516
- let p = 0;
517
- S(c, (A) => {
518
- A.position.copy(C[p++]);
515
+ let f = 0;
516
+ v(c, (C) => {
517
+ C.position.copy(u[f++]);
519
518
  });
520
519
  });
521
520
  }
522
521
  }
523
522
  }
524
523
  }
525
- const { objectHandle: v } = T.utils;
526
- class Tt extends f {
524
+ const { objectHandle: R } = T.utils;
525
+ class Rt extends A {
527
526
  constructor(t, s) {
528
527
  super(t, s);
529
528
  }
530
529
  async exec(t) {
531
530
  const s = this.findProp("objects", [n.READ_CTX, n.LOCAL]), i = this.findProp("axis", [n.READ_CTX, n.LOCAL]), o = this.findProp("scale", [n.READ_CTX, n.LOCAL]), a = await t.getTarget?.(this);
532
531
  if (s && i && o) {
533
- const c = this.getValue(s, a), h = this.getValue(i), u = this.getValue(o);
532
+ const c = this.getValue(s, a), h = this.getValue(i), d = this.getValue(o);
534
533
  if (c) {
535
- const C = [];
536
- v(c, (p) => {
537
- C.push(p.scale.clone());
534
+ const u = [];
535
+ R(c, (f) => {
536
+ u.push(f.scale.clone());
538
537
  });
539
- const P = (p, A) => {
538
+ const P = (f, C) => {
540
539
  switch (h) {
541
540
  case "x":
542
- p.setX(A.x);
541
+ f.setX(C.x);
543
542
  break;
544
543
  case "y":
545
- p.setY(A.y);
544
+ f.setY(C.y);
546
545
  break;
547
546
  case "z":
548
- p.setZ(A.z);
547
+ f.setZ(C.z);
549
548
  break;
550
549
  }
551
550
  };
552
551
  await (async () => {
553
- const p = v(c, async (A) => {
554
- const O = A.scale.clone();
552
+ const f = R(c, async (C) => {
553
+ const g = C.scale.clone();
555
554
  switch (h) {
556
555
  case "x":
557
- await this.ssp.animation(O, new I().set(O.x * u, O.y, O.z), { duration: 800 }, (g) => P(A.scale, g));
556
+ await this.ssp.animation(g, new I().set(g.x * d, g.y, g.z), { duration: 800 }, (O) => P(C.scale, O));
558
557
  break;
559
558
  case "y":
560
- await this.ssp.animation(O, new I().set(O.x, O.y * u, O.z), { duration: 800 }, (g) => P(A.scale, g));
559
+ await this.ssp.animation(g, new I().set(g.x, g.y * d, g.z), { duration: 800 }, (O) => P(C.scale, O));
561
560
  break;
562
561
  case "z":
563
- await this.ssp.animation(O, new I().set(O.x, O.y, O.z * u), { duration: 800 }, (g) => P(A.scale, g));
562
+ await this.ssp.animation(g, new I().set(g.x, g.y, g.z * d), { duration: 800 }, (O) => P(C.scale, O));
564
563
  break;
565
564
  }
566
565
  });
567
- p instanceof Array ? await Promise.all(p) : await p, this.ssp.render();
566
+ f instanceof Array ? await Promise.all(f) : await f, this.ssp.render();
568
567
  })(), this.cleanSets.add(() => {
569
- let p = 0;
570
- v(c, (A) => {
571
- A.scale.copy(C[p++]);
568
+ let f = 0;
569
+ R(c, (C) => {
570
+ C.scale.copy(u[f++]);
572
571
  });
573
572
  });
574
573
  }
@@ -576,59 +575,59 @@ class Tt extends f {
576
575
  }
577
576
  }
578
577
  const { objectHandle: V } = T.utils;
579
- class Et extends f {
578
+ class Vt extends A {
580
579
  constructor(t, s) {
581
580
  super(t, s);
582
581
  }
583
582
  async exec(t) {
584
583
  const s = this.findProp("objects", [n.READ_CTX, n.LOCAL]), i = this.findProp("axis", [n.READ_CTX, n.LOCAL]), o = this.findProp("rotation", [n.READ_CTX, n.LOCAL]), a = await t.getTarget?.(this);
585
584
  if (s && i && o) {
586
- const c = this.getValue(s, a), h = this.getValue(i), u = this.getValue(o);
585
+ const c = this.getValue(s, a), h = this.getValue(i), d = this.getValue(o);
587
586
  if (c) {
588
- const C = [];
589
- V(c, (p) => {
590
- C.push(p.rotation.clone());
587
+ const u = [];
588
+ V(c, (f) => {
589
+ u.push(f.rotation.clone());
591
590
  });
592
- const P = (p, A) => {
591
+ const P = (f, C) => {
593
592
  switch (h) {
594
593
  case "x":
595
- p.x = A.x;
594
+ f.x = C.x;
596
595
  break;
597
596
  case "y":
598
- p.y = A.y;
597
+ f.y = C.y;
599
598
  break;
600
599
  case "z":
601
- p.z = A.z;
600
+ f.z = C.z;
602
601
  break;
603
602
  }
604
603
  };
605
604
  await (async () => {
606
- const p = u / 180 * Math.PI, A = V(c, async (O) => {
607
- const g = O.rotation.clone();
605
+ const f = d / 180 * Math.PI, C = V(c, async (g) => {
606
+ const O = g.rotation.clone();
608
607
  switch (h) {
609
608
  case "x":
610
- await this.ssp.animation(g, new D().set(g.x + p, g.y, g.z), { duration: 800 }, (m) => P(O.rotation, m));
609
+ await this.ssp.animation(O, new D().set(O.x + f, O.y, O.z), { duration: 800 }, (m) => P(g.rotation, m));
611
610
  break;
612
611
  case "y":
613
- await this.ssp.animation(g, new D().set(g.x, g.y + p, g.z), { duration: 800 }, (m) => P(O.rotation, m));
612
+ await this.ssp.animation(O, new D().set(O.x, O.y + f, O.z), { duration: 800 }, (m) => P(g.rotation, m));
614
613
  break;
615
614
  case "z":
616
- await this.ssp.animation(g, new D().set(g.x, g.y, g.z + p), { duration: 800 }, (m) => P(O.rotation, m));
615
+ await this.ssp.animation(O, new D().set(O.x, O.y, O.z + f), { duration: 800 }, (m) => P(g.rotation, m));
617
616
  break;
618
617
  }
619
618
  });
620
- A instanceof Array ? await Promise.all(A) : await A, this.ssp.render();
619
+ C instanceof Array ? await Promise.all(C) : await C, this.ssp.render();
621
620
  })(), this.cleanSets.add(() => {
622
- let p = 0;
623
- V(c, (A) => {
624
- A.rotation.copy(C[p++]);
621
+ let f = 0;
622
+ V(c, (C) => {
623
+ C.rotation.copy(u[f++]);
625
624
  });
626
625
  });
627
626
  }
628
627
  }
629
628
  }
630
629
  }
631
- class wt extends f {
630
+ class Ht extends A {
632
631
  constructor(t, s) {
633
632
  super(t, s);
634
633
  }
@@ -640,7 +639,7 @@ class wt extends f {
640
639
  }
641
640
  }
642
641
  }
643
- class Lt extends f {
642
+ class jt extends A {
644
643
  constructor(t, s) {
645
644
  super(t, s);
646
645
  }
@@ -648,23 +647,23 @@ class Lt extends f {
648
647
  const t = this.findProp("space", n.LOCAL), s = this.findProp("out", n.WRITE_CTX);
649
648
  if (t && s) {
650
649
  const i = l(t.value), o = l(s.value);
651
- this.writeContext(o, E(this.ssp, i));
650
+ this.writeContext(o, w(this.ssp, i));
652
651
  }
653
652
  }
654
653
  }
655
- class It extends f {
654
+ class Xt extends A {
656
655
  constructor(t, s) {
657
656
  super(t, s);
658
657
  }
659
658
  async exec() {
660
659
  const t = this.findProp("spaces", n.LOCAL), s = this.findProp("out", n.WRITE_CTX);
661
660
  if (t && s) {
662
- const i = l(t.value), o = l(s.value), a = i.map((c) => E(this.ssp, c));
661
+ const i = l(t.value), o = l(s.value), a = i.map((c) => w(this.ssp, c));
663
662
  this.writeContext(o, a);
664
663
  }
665
664
  }
666
665
  }
667
- class mt extends f {
666
+ class Ut extends A {
668
667
  constructor(t, s) {
669
668
  super(t, s);
670
669
  }
@@ -672,43 +671,43 @@ class mt extends f {
672
671
  const s = this.findProp("poi", n.LOCAL), i = this.findProp("out", n.WRITE_CTX);
673
672
  if (s && i) {
674
673
  const o = l(s.value), a = l(i.value);
675
- this.writeContext(a, E(this.ssp, o));
674
+ this.writeContext(a, w(this.ssp, o));
676
675
  }
677
676
  }
678
677
  }
679
- class Nt extends f {
678
+ class kt extends A {
680
679
  constructor(t, s) {
681
680
  super(t, s);
682
681
  }
683
682
  async exec(t) {
684
683
  const s = this.findProp("pois", n.LOCAL), i = this.findProp("out", n.WRITE_CTX);
685
684
  if (s && i) {
686
- const o = l(s.value), a = l(i.value), c = o.map((h) => E(this.ssp, h));
685
+ const o = l(s.value), a = l(i.value), c = o.map((h) => w(this.ssp, h));
687
686
  this.writeContext(a, c);
688
687
  }
689
688
  }
690
689
  }
691
- class bt extends f {
690
+ class Bt extends A {
692
691
  constructor(t, s) {
693
692
  super(t, s);
694
693
  }
695
694
  async exec() {
696
695
  const t = this.findProp("value", n.LOCAL), s = this.findProp("object", n.LOCAL), i = this.findProp("out", n.WRITE_CTX), o = this.findProp("extraction", n.LOCAL);
697
696
  if (t && i && o && s) {
698
- const a = l(o.value), c = l(i.value), h = l(s.value), u = this.getValue(s);
699
- let C = l(t.value);
697
+ const a = l(o.value), c = l(i.value), h = l(s.value), d = this.getValue(s);
698
+ let u = l(t.value);
700
699
  if (this.ctx._userDataMap) {
701
- const d = this.ctx._userDataMap.get(h);
702
- d && (C = d[a]);
703
- } else if (u && u.userData.properties) {
704
- const d = u.userData.properties.find((P) => P.key === a);
705
- d && d.value !== void 0 && (C = d.value);
700
+ const p = this.ctx._userDataMap.get(h);
701
+ p && (u = p[a]);
702
+ } else if (d && d.userData.properties) {
703
+ const p = d.userData.properties.find((P) => P.key === a);
704
+ p && p.value !== void 0 && (u = p.value);
706
705
  }
707
- this.writeContext(c, C);
706
+ this.writeContext(c, u);
708
707
  }
709
708
  }
710
709
  }
711
- class _t extends f {
710
+ class Gt extends A {
712
711
  constructor(t, s) {
713
712
  super(t, s);
714
713
  }
@@ -723,7 +722,7 @@ class _t extends f {
723
722
  }
724
723
  }
725
724
  }
726
- class xt extends f {
725
+ class Wt extends A {
727
726
  constructor(t, s) {
728
727
  super(t, s);
729
728
  }
@@ -731,23 +730,23 @@ class xt extends f {
731
730
  const t = this.findProp("path", n.LOCAL), s = this.findProp("out", n.WRITE_CTX);
732
731
  if (t && s) {
733
732
  const i = l(t.value), o = l(s.value);
734
- this.writeContext(o, E(this.ssp, i));
733
+ this.writeContext(o, w(this.ssp, i));
735
734
  }
736
735
  }
737
736
  }
738
- class yt extends f {
737
+ class Ft extends A {
739
738
  constructor(t, s) {
740
739
  super(t, s);
741
740
  }
742
741
  async exec() {
743
742
  const t = this.findProp("paths", n.LOCAL), s = this.findProp("out", n.WRITE_CTX);
744
743
  if (t && s) {
745
- const i = l(t.value), o = l(s.value), a = i.map((c) => E(this.ssp, c));
744
+ const i = l(t.value), o = l(s.value), a = i.map((c) => w(this.ssp, c));
746
745
  this.writeContext(o, a);
747
746
  }
748
747
  }
749
748
  }
750
- class Mt extends f {
749
+ class zt extends A {
751
750
  constructor(t, s) {
752
751
  super(t, s);
753
752
  }
@@ -764,7 +763,7 @@ class Mt extends f {
764
763
  }
765
764
  }
766
765
  }
767
- class Dt extends f {
766
+ class Yt extends A {
768
767
  constructor(t, s) {
769
768
  super(t, s);
770
769
  }
@@ -789,7 +788,7 @@ class Dt extends f {
789
788
  }
790
789
  }
791
790
  }
792
- class St extends f {
791
+ class $t extends A {
793
792
  constructor(t, s) {
794
793
  super(t, s);
795
794
  }
@@ -812,15 +811,57 @@ class St extends f {
812
811
  }
813
812
  }
814
813
  }
814
+ const { animation: Kt } = T, H = /* @__PURE__ */ Symbol("initialTransform");
815
+ class W extends G {
816
+ constructor(t, s) {
817
+ super(), this.ssp = t, this.target = s, this.tweenSet = /* @__PURE__ */ new Set();
818
+ }
819
+ initTransform(t) {
820
+ const { position: s, rotation: i, scale: o } = this.target, a = t ?? { position: s.clone(), rotation: i.clone(), scale: o.clone() };
821
+ return Reflect.set(this.target, H, a), a;
822
+ }
823
+ getInitialTransform() {
824
+ return Reflect.get(this.target, H);
825
+ }
826
+ async play(t) {
827
+ var s, i, o, a;
828
+ let c = this.getInitialTransform();
829
+ c || (c = this.initTransform());
830
+ for (let h = 0; h < t.length; h++) {
831
+ let d = t[h - 1];
832
+ d || (d = c);
833
+ const u = t[h], p = d.position, P = d.rotation, E = d.scale, f = u.position, C = u.rotation, g = u.scale, O = (s = u.delay) !== null && s !== void 0 ? s : 0, m = (i = u.duration) !== null && i !== void 0 ? i : 1e3, K = u.easing, Z = u.repeat === -1 ? 1 / 0 : (o = u.repeat) !== null && o !== void 0 ? o : 0, J = (a = u.yoyo) !== null && a !== void 0 && a;
834
+ await Kt({ x: p.x, y: p.y, z: p.z, rotationX: P.x, rotationY: P.y, rotationZ: P.z, scaleX: E.x, scaleY: E.y, scaleZ: E.z }, { x: f.x, y: f.y, z: f.z, rotationX: C.x, rotationY: C.y, rotationZ: C.z, scaleX: g.x, scaleY: g.y, scaleZ: g.z }, { delay: O, duration: m, mode: K, repeat: Z, yoyo: J }, ((b, q) => {
835
+ const { x: Q, y: tt, z: st, rotationX: et, rotationY: it, rotationZ: ot, scaleX: nt, scaleY: at, scaleZ: ct } = b;
836
+ this.target.position.set(Q, tt, st), this.target.rotation.set(et, it, ot), this.target.scale.set(nt, at, ct), this.dispatchEvent({ type: "update", source: b, tween: q });
837
+ }), ((b) => {
838
+ this.tweenSet.add(b), this.dispatchEvent({ type: "start", tween: b });
839
+ }));
840
+ }
841
+ }
842
+ stop() {
843
+ this.tweenSet.forEach(((t) => t.stop())), this.tweenSet.clear();
844
+ }
845
+ reset() {
846
+ const t = this.getInitialTransform();
847
+ if (t) {
848
+ const { position: s, rotation: i, scale: o } = t;
849
+ this.target.position.copy(s), this.target.rotation.set(i.x, i.y, i.z), this.target.scale.copy(o), this.ssp.render();
850
+ }
851
+ }
852
+ dispose() {
853
+ this.stop(), this.reset(), Reflect.deleteProperty(this.target, H);
854
+ }
855
+ }
815
856
  const N = /* @__PURE__ */ new Map();
816
- async function vt(e, t, s) {
817
- const { id: i, keyframes: o } = s, a = new k(e, t);
857
+ async function Zt(e, t, s) {
858
+ const { id: i, keyframes: o } = s, a = new W(e, t);
818
859
  N.has(i) || N.set(i, /* @__PURE__ */ new Set()), N.get(i)?.add(a), await a.play(o);
819
860
  }
820
- function B(e) {
861
+ function F(e) {
821
862
  N.get(e)?.forEach((t) => t.stop()), N.get(e)?.clear();
822
863
  }
823
- class Vt extends f {
864
+ class Jt extends A {
824
865
  constructor(t, s) {
825
866
  super(t, s);
826
867
  }
@@ -829,13 +870,13 @@ class Vt extends f {
829
870
  if (s && i && o) {
830
871
  const a = this.getValue(s), c = l(i.value), h = l(o.value);
831
872
  if (a) {
832
- const u = await t.getAnimations?.(this, a, c);
833
- if (u) {
834
- const C = u.find((d) => d.id === c);
835
- C && await W(async () => {
836
- const d = a.matrix.clone();
837
- await vt(this.ssp, a, C), this.cleanSets.add(() => {
838
- B(C.id), a && d.decompose(a.position, a.quaternion, a.scale);
873
+ const d = await t.getAnimations?.(this, a, c);
874
+ if (d) {
875
+ const u = d.find((p) => p.id === c);
876
+ u && await Y(async () => {
877
+ const p = a.matrix.clone();
878
+ await Zt(this.ssp, a, u), this.cleanSets.add(() => {
879
+ F(u.id), a && p.decompose(a.position, a.quaternion, a.scale);
839
880
  });
840
881
  }, h);
841
882
  }
@@ -843,7 +884,7 @@ class Vt extends f {
843
884
  }
844
885
  }
845
886
  }
846
- class Ht extends f {
887
+ class qt extends A {
847
888
  constructor(t, s) {
848
889
  super(t, s);
849
890
  }
@@ -851,19 +892,19 @@ class Ht extends f {
851
892
  const t = this.findProp("animation", n.LOCAL);
852
893
  if (t) {
853
894
  const s = l(t.value);
854
- B(s);
895
+ F(s);
855
896
  }
856
897
  }
857
898
  }
858
- const b = /* @__PURE__ */ new Map();
859
- async function Rt(e, t, s) {
860
- const { id: i, keyframes: o } = s, a = new k(e, t);
861
- b.has(i) || b.set(i, /* @__PURE__ */ new Set()), b.get(i)?.add(a), await a.play(o);
899
+ const _ = /* @__PURE__ */ new Map();
900
+ async function Qt(e, t, s) {
901
+ const { id: i, keyframes: o } = s, a = new W(e, t);
902
+ _.has(i) || _.set(i, /* @__PURE__ */ new Set()), _.get(i)?.add(a), await a.play(o);
862
903
  }
863
- function G(e) {
864
- b.get(e)?.forEach((t) => t.stop()), b.get(e)?.clear();
904
+ function z(e) {
905
+ _.get(e)?.forEach((t) => t.stop()), _.get(e)?.clear();
865
906
  }
866
- class jt extends f {
907
+ class ts extends A {
867
908
  constructor(t, s) {
868
909
  super(t, s);
869
910
  }
@@ -872,16 +913,16 @@ class jt extends f {
872
913
  if (s && i && o) {
873
914
  const a = this.getValue(s), c = l(i.value), h = l(o.value);
874
915
  if (a) {
875
- const u = await t.getComponentAnimations?.(this, a, c);
876
- if (u) {
877
- const C = u.find((d) => d.id === c);
878
- if (C) {
879
- let d = null;
880
- s.valueType === "Mesh" ? d = a : s.valueType === "Model" && (d = _(a, C.refId)), d && await W(async () => {
881
- if (d) {
882
- const P = d.matrix.clone();
883
- await Rt(this.ssp, d, C), this.cleanSets.add(() => {
884
- G(C.id), d && P.decompose(d.position, d.quaternion, d.scale);
916
+ const d = await t.getComponentAnimations?.(this, a, c);
917
+ if (d) {
918
+ const u = d.find((p) => p.id === c);
919
+ if (u) {
920
+ let p = null;
921
+ s.valueType === "Mesh" ? p = a : s.valueType === "Model" && (p = y(a, u.refId)), p && await Y(async () => {
922
+ if (p) {
923
+ const P = p.matrix.clone();
924
+ await Qt(this.ssp, p, u), this.cleanSets.add(() => {
925
+ z(u.id), p && P.decompose(p.position, p.quaternion, p.scale);
885
926
  });
886
927
  }
887
928
  }, h);
@@ -891,7 +932,7 @@ class jt extends f {
891
932
  }
892
933
  }
893
934
  }
894
- class Xt extends f {
935
+ class ss extends A {
895
936
  constructor(t, s) {
896
937
  super(t, s);
897
938
  }
@@ -899,123 +940,123 @@ class Xt extends f {
899
940
  const t = this.findProp("animation", n.LOCAL);
900
941
  if (t) {
901
942
  const s = l(t.value);
902
- G(s);
943
+ z(s);
903
944
  }
904
945
  }
905
946
  }
906
- function Ut(e, t) {
947
+ function es(e, t) {
907
948
  switch (t.type) {
908
949
  case r.START:
909
- return new Z(e, t);
950
+ return new pt(e, t);
910
951
  case r.COLOR:
911
- return new Q(e, t);
952
+ return new ft(e, t);
912
953
  case r.NUMBER:
913
- return new tt(e, t);
954
+ return new Ct(e, t);
914
955
  case r.HIGHLIGHT:
915
- return new st(e, t);
956
+ return new At(e, t);
916
957
  case r.UN_HIGHLIGHT:
917
- return new it(e, t);
958
+ return new Ot(e, t);
918
959
  case r.OPACITY:
919
- return new nt(e, t);
960
+ return new Tt(e, t);
920
961
  case r.UN_OPACITY:
921
- return new ct(e, t);
962
+ return new Et(e, t);
922
963
  case r.EMISSIVE:
923
- return new rt(e, t);
964
+ return new Lt(e, t);
924
965
  case r.UN_EMISSIVE:
925
- return new ht(e, t);
966
+ return new xt(e, t);
926
967
  // 获取对象
927
968
  case r.MESH:
928
- return new ut(e, t);
969
+ return new It(e, t);
929
970
  case r.MESHES:
930
- return new dt(e, t);
971
+ return new bt(e, t);
931
972
  case r.MODEL:
932
- return new pt(e, t);
973
+ return new Nt(e, t);
933
974
  case r.MODELS:
934
- return new ft(e, t);
975
+ return new _t(e, t);
935
976
  case r.SPACE:
936
- return new Lt(e, t);
977
+ return new jt(e, t);
937
978
  case r.SPACES:
938
- return new It(e, t);
979
+ return new Xt(e, t);
939
980
  case r.POIS:
940
- return new Nt(e, t);
981
+ return new kt(e, t);
941
982
  case r.POI:
942
- return new mt(e, t);
983
+ return new Ut(e, t);
943
984
  case r.PATH:
944
- return new xt(e, t);
985
+ return new Wt(e, t);
945
986
  case r.PATHS:
946
- return new yt(e, t);
987
+ return new Ft(e, t);
947
988
  // 逻辑节点
948
989
  case r.DELAY:
949
- return new Ct(e, t);
990
+ return new yt(e, t);
950
991
  case r.CONDITION_NODE:
951
- return new At(e, t);
992
+ return new Mt(e, t);
952
993
  // 显示隐藏
953
994
  case r.SHOW:
954
- return new Ot(e, t);
995
+ return new St(e, t);
955
996
  case r.HIDE:
956
- return new gt(e, t);
997
+ return new Dt(e, t);
957
998
  // 动画相关
958
999
  case r.CLIP_ANIMATION:
959
- return new Dt(e, t);
1000
+ return new Yt(e, t);
960
1001
  case r.UN_CLIP_ANIMATION:
961
- return new St(e, t);
1002
+ return new $t(e, t);
962
1003
  case r.TWEEN_ANIMATION:
963
- return new Vt(e, t);
1004
+ return new Jt(e, t);
964
1005
  case r.UN_TWEEN_ANIMATION:
965
- return new Ht(e, t);
1006
+ return new qt(e, t);
966
1007
  case r.COMPONENT_TWEEN_ANIMATION:
967
- return new jt(e, t);
1008
+ return new ts(e, t);
968
1009
  case r.UN_COMPONENT_TWEEN_ANIMATION:
969
- return new Xt(e, t);
1010
+ return new ss(e, t);
970
1011
  // 移动
971
1012
  case r.TRANSLATE:
972
- return new Pt(e, t);
1013
+ return new vt(e, t);
973
1014
  case r.ROTATE:
974
- return new Et(e, t);
1015
+ return new Vt(e, t);
975
1016
  case r.SCALE:
976
- return new Tt(e, t);
1017
+ return new Rt(e, t);
977
1018
  case r.FLY_TO:
978
- return new wt(e, t);
1019
+ return new Ht(e, t);
979
1020
  // 数据处理节点
980
1021
  case r.DATA_EXTRACTION:
981
- return new bt(e, t);
1022
+ return new Bt(e, t);
982
1023
  case r.DATA_FILTER:
983
- return new _t(e, t);
1024
+ return new Gt(e, t);
984
1025
  case r.USER_DATA_NODE:
985
- return new Mt(e, t);
1026
+ return new zt(e, t);
986
1027
  default:
987
- return new f(e, t);
1028
+ return new A(e, t);
988
1029
  }
989
1030
  }
990
1031
  function l(e) {
991
1032
  return JSON.parse(e);
992
1033
  }
993
- async function W(e, t) {
1034
+ async function Y(e, t) {
994
1035
  t ? await e() : e();
995
1036
  }
996
- function kt(e, t) {
1037
+ function is(e, t) {
997
1038
  return t.map((s) => e.getObjectById(s)).filter(Boolean);
998
1039
  }
999
- function E(e, t, s) {
1040
+ function w(e, t, s) {
1000
1041
  const i = e.getObjectById(t);
1001
1042
  if (i)
1002
1043
  return i;
1003
1044
  {
1004
1045
  const { viewport: { scene: o } } = e;
1005
- return _(s ?? o, t);
1046
+ return y(s ?? o, t);
1006
1047
  }
1007
1048
  }
1008
- function _(e, t) {
1049
+ function y(e, t) {
1009
1050
  if (e.userData.key === t || e.uuid === t) return e;
1010
1051
  for (let s = 0, i = e.children.length; s < i; s++) {
1011
- const o = e.children[s], a = _(o, t);
1052
+ const o = e.children[s], a = y(o, t);
1012
1053
  if (a !== null)
1013
1054
  return a;
1014
1055
  }
1015
1056
  return null;
1016
1057
  }
1017
- const { utils: { sleep: Bt } } = T;
1018
- class Gt extends z {
1058
+ const { utils: { sleep: os } } = T;
1059
+ class ns extends G {
1019
1060
  ssp;
1020
1061
  flow;
1021
1062
  nodes;
@@ -1049,10 +1090,10 @@ class Gt extends z {
1049
1090
  this.clear();
1050
1091
  const { nodes: t, edges: s } = this.flow;
1051
1092
  t.forEach((i) => {
1052
- const o = Ut(this, i);
1093
+ const o = es(this, i);
1053
1094
  this.addNode(o);
1054
1095
  }), s.forEach((i) => {
1055
- const o = new K(i);
1096
+ const o = new ht(i);
1056
1097
  this.addEdge(o);
1057
1098
  const a = this.getNodeById(i.source), c = this.getNodeById(i.target);
1058
1099
  a && c && (a.postNodes.push(c), c.prevNodes.push(a));
@@ -1073,7 +1114,7 @@ class Gt extends z {
1073
1114
  async debug(t = {}, s = 1500) {
1074
1115
  const i = this.onNodeAfter;
1075
1116
  this.onNodeAfter = async (o) => {
1076
- await Bt(s), i?.(o);
1117
+ await os(s), i?.(o);
1077
1118
  }, await this.run(t);
1078
1119
  }
1079
1120
  /**
@@ -1100,14 +1141,14 @@ class Gt extends z {
1100
1141
  this.stop(), this.cleanup();
1101
1142
  }
1102
1143
  }
1103
- class Wt extends Gt {
1144
+ class as extends ns {
1104
1145
  flow;
1105
1146
  constructor(t, s) {
1106
1147
  super(t, s), this.flow = s;
1107
1148
  }
1108
1149
  }
1109
- const R = (e, t) => e.userData.key === t ? e : e.parent ? R(e.parent, t) : !1, { groupBy: Ft, asyncRunWithCode: zt } = T.utils;
1110
- class Yt {
1150
+ const X = (e, t) => e.userData.key === t ? e : e.parent ? X(e.parent, t) : !1, { groupBy: cs, asyncRunWithCode: rs } = T.utils;
1151
+ class ls {
1111
1152
  ssp;
1112
1153
  interaction;
1113
1154
  flows;
@@ -1117,29 +1158,29 @@ class Yt {
1117
1158
  status = "ready";
1118
1159
  target;
1119
1160
  constructor(t, s, i, o) {
1120
- this.ssp = t, this.interaction = s, this.flows = i, this.flowsMap = Ft(i, "id"), this.options = o || {}, this.init();
1161
+ this.ssp = t, this.interaction = s, this.flows = i, this.flowsMap = cs(i, "id"), this.options = o || {}, this.init();
1121
1162
  }
1122
1163
  init() {
1123
1164
  switch (this.interaction.type) {
1124
- case L.MOUSE_CLICK:
1165
+ case x.MOUSE_CLICK:
1125
1166
  this.initMouseClick();
1126
1167
  break;
1127
- case L.MOUSE_DB_CLICK:
1168
+ case x.MOUSE_DB_CLICK:
1128
1169
  this.initMouseDbClick();
1129
1170
  break;
1130
- case L.MOUSE_RIGHT_CLICK:
1171
+ case x.MOUSE_RIGHT_CLICK:
1131
1172
  this.initMouseRightClick();
1132
1173
  break;
1133
- case L.LOADED:
1174
+ case x.LOADED:
1134
1175
  this.initLoaded();
1135
1176
  break;
1136
- case L.THING_PROP_CHANGE:
1177
+ case x.THING_PROP_CHANGE:
1137
1178
  this.initThingPropChange();
1138
1179
  break;
1139
- case L.THING_EVENT:
1180
+ case x.THING_EVENT:
1140
1181
  this.initThingEvent();
1141
1182
  break;
1142
- case L.MODEL_PROP_CHANGE:
1183
+ case x.MODEL_PROP_CHANGE:
1143
1184
  this.initModelPropChange();
1144
1185
  break;
1145
1186
  }
@@ -1147,9 +1188,9 @@ class Yt {
1147
1188
  // 获取交互触发
1148
1189
  async getObsTarget(t) {
1149
1190
  const { obsType: s, obsTargets: i, editionId: o } = this.interaction;
1150
- if (s === j.GLOBAL)
1191
+ if (s === U.GLOBAL)
1151
1192
  return null;
1152
- if (s === j.INSTANCE) {
1193
+ if (s === U.INSTANCE) {
1153
1194
  let a;
1154
1195
  o ? (a = this.ssp.getModelById(o), a || console.warn("Target not found:", o)) : a = i?.map((c) => {
1155
1196
  const h = this.ssp.getModelById(c);
@@ -1161,7 +1202,7 @@ class Yt {
1161
1202
  // 模型事件触发
1162
1203
  modelHandler(t) {
1163
1204
  const { target: s, currentTarget: i } = t, o = this.interaction.editionId;
1164
- o ? (s.sid === o || s.userData.familyId === o) && R(i, this.interaction.modelId) && (this.target = s, this.execBehavior()) : this.interaction.obsTargets?.forEach((a) => {
1205
+ o ? (s.sid === o || s.userData.familyId === o) && X(i, this.interaction.modelId) && (this.target = s, this.execBehavior()) : this.interaction.obsTargets?.forEach((a) => {
1165
1206
  (a === s.userData.id || a === s.userData.sid) && (this.target = s, this.execBehavior());
1166
1207
  });
1167
1208
  }
@@ -1170,8 +1211,8 @@ class Yt {
1170
1211
  t.forEach((i) => {
1171
1212
  const o = this.flowsMap.get(i);
1172
1213
  if (o) {
1173
- const a = new Y(this.ssp, o[0]);
1174
- a.parse(), zt(
1214
+ const a = new rt(this.ssp, o[0]);
1215
+ a.parse(), rs(
1175
1216
  () => a.run({
1176
1217
  getTarget: s,
1177
1218
  getAnimations: this.options.getAnimations,
@@ -1187,7 +1228,7 @@ class Yt {
1187
1228
  this.status = "running";
1188
1229
  const { behaviors: s } = this.interaction;
1189
1230
  s?.forEach((i) => {
1190
- i.action === $.FLOW && i.actionRefs && this.runFlowByIds(i.actionRefs);
1231
+ i.action === lt.FLOW && i.actionRefs && this.runFlowByIds(i.actionRefs);
1191
1232
  }), this.options?.onTrigger && this.options?.onTrigger(this.interaction);
1192
1233
  } catch (s) {
1193
1234
  this.status = "error", this.options?.onError && this.options?.onError(s);
@@ -1239,35 +1280,35 @@ class Yt {
1239
1280
  this.disposables.forEach((t) => t());
1240
1281
  }
1241
1282
  }
1242
- var $t = /* @__PURE__ */ ((e) => (e.GLOBAL = "GLOBAL", e.SELF = "SELF", e.OTHER = "OTHER", e))($t || {}), F = /* @__PURE__ */ ((e) => (e.FLOW = "FLOW", e.ANIMATION = "ANIMATION", e.DELAY = "DELAY", e))(F || {}), H = /* @__PURE__ */ ((e) => (e.GLOBAL = "GLOBAL", e.INSTANCE = "INSTANCE", e.FAMILY = "FAMILY", e))(H || {}), w = /* @__PURE__ */ ((e) => (e.MOUSE_CLICK = "MOUSE_CLICK", e.MOUSE_DB_CLICK = "MOUSE_DB_CLICK", e.MOUSE_RIGHT_CLICK = "MOUSE_RIGHT_CLICK", e.THING_PROP_CHANGE = "THING_PROP_CHANGE", e.THING_EVENT = "THING_EVENT", e.LOADED = "LOADED", e.MODEL_PROP_CHANGE = "MODEL_PROP_CHANGE", e))(w || {});
1243
- const { groupBy: Kt, asyncRunWithCode: Jt } = T.utils;
1244
- class is extends Yt {
1283
+ var hs = /* @__PURE__ */ ((e) => (e.GLOBAL = "GLOBAL", e.SELF = "SELF", e.OTHER = "OTHER", e))(hs || {}), $ = /* @__PURE__ */ ((e) => (e.FLOW = "FLOW", e.ANIMATION = "ANIMATION", e.DELAY = "DELAY", e))($ || {}), j = /* @__PURE__ */ ((e) => (e.GLOBAL = "GLOBAL", e.INSTANCE = "INSTANCE", e.FAMILY = "FAMILY", e))(j || {}), L = /* @__PURE__ */ ((e) => (e.MOUSE_CLICK = "MOUSE_CLICK", e.MOUSE_DB_CLICK = "MOUSE_DB_CLICK", e.MOUSE_RIGHT_CLICK = "MOUSE_RIGHT_CLICK", e.THING_PROP_CHANGE = "THING_PROP_CHANGE", e.THING_EVENT = "THING_EVENT", e.LOADED = "LOADED", e.MODEL_PROP_CHANGE = "MODEL_PROP_CHANGE", e))(L || {});
1284
+ const { groupBy: us, asyncRunWithCode: ds } = T.utils;
1285
+ class Os extends ls {
1245
1286
  flows;
1246
1287
  flowsMap;
1247
1288
  constructor(t, s, i, o) {
1248
- super(t, s, i, o), this.flows = i, this.flowsMap = Kt(i, "id");
1289
+ super(t, s, i, o), this.flows = i, this.flowsMap = us(i, "id");
1249
1290
  }
1250
1291
  init() {
1251
1292
  switch (this.interaction.type) {
1252
- case w.MOUSE_CLICK:
1293
+ case L.MOUSE_CLICK:
1253
1294
  this.initMouseClick();
1254
1295
  break;
1255
- case w.MOUSE_DB_CLICK:
1296
+ case L.MOUSE_DB_CLICK:
1256
1297
  this.initMouseDbClick();
1257
1298
  break;
1258
- case w.MOUSE_RIGHT_CLICK:
1299
+ case L.MOUSE_RIGHT_CLICK:
1259
1300
  this.initMouseRightClick();
1260
1301
  break;
1261
- case w.LOADED:
1302
+ case L.LOADED:
1262
1303
  this.initLoaded();
1263
1304
  break;
1264
- case w.THING_PROP_CHANGE:
1305
+ case L.THING_PROP_CHANGE:
1265
1306
  this.initThingPropChange();
1266
1307
  break;
1267
- case w.THING_EVENT:
1308
+ case L.THING_EVENT:
1268
1309
  this.initThingEvent();
1269
1310
  break;
1270
- case w.MODEL_PROP_CHANGE:
1311
+ case L.MODEL_PROP_CHANGE:
1271
1312
  this.initModelPropChange();
1272
1313
  break;
1273
1314
  }
@@ -1275,11 +1316,11 @@ class is extends Yt {
1275
1316
  // 获取交互触发的Mesh
1276
1317
  async getComponentObsTarget(t) {
1277
1318
  const { obsType: s, obsTargets: i } = this.interaction;
1278
- if (s === H.GLOBAL)
1319
+ if (s === j.GLOBAL)
1279
1320
  return null;
1280
- if (s === H.INSTANCE) {
1321
+ if (s === j.INSTANCE) {
1281
1322
  const o = i?.map((a) => {
1282
- const c = E(this.ssp, a);
1323
+ const c = w(this.ssp, a);
1283
1324
  return c || console.warn("Component Target not found:", a), c;
1284
1325
  });
1285
1326
  return o ? o[0] : null;
@@ -1290,7 +1331,7 @@ class is extends Yt {
1290
1331
  modelHandler(t) {
1291
1332
  const { currentTarget: s } = t;
1292
1333
  this.interaction.obsTargets?.forEach((i) => {
1293
- R(s, i) && this.execBehavior();
1334
+ X(s, i) && this.execBehavior();
1294
1335
  });
1295
1336
  }
1296
1337
  // 物模型事件触发
@@ -1305,8 +1346,8 @@ class is extends Yt {
1305
1346
  t.forEach((i) => {
1306
1347
  const o = this.flowsMap.get(i);
1307
1348
  if (o) {
1308
- const a = new Wt(this.ssp, o[0]);
1309
- a.parse(), Jt(
1349
+ const a = new as(this.ssp, o[0]);
1350
+ a.parse(), ds(
1310
1351
  () => a.run({
1311
1352
  getTarget: s
1312
1353
  })
@@ -1318,7 +1359,7 @@ class is extends Yt {
1318
1359
  try {
1319
1360
  const { behaviors: t } = this.interaction;
1320
1361
  t?.forEach((s) => {
1321
- s.action === F.FLOW && s.actionRefs && this.runFlowByIds(s.actionRefs);
1362
+ s.action === $.FLOW && s.actionRefs && this.runFlowByIds(s.actionRefs);
1322
1363
  }), this.options?.onTrigger && this.options?.onTrigger(this.interaction);
1323
1364
  } catch (t) {
1324
1365
  this.options?.onError && this.options?.onError(t);
@@ -1345,15 +1386,16 @@ class is extends Yt {
1345
1386
  }
1346
1387
  }
1347
1388
  export {
1348
- Wt as ComponentFlowParser,
1349
- is as ComponentTrigger,
1350
- Gt as FlowParser,
1351
- F as InteractionAction,
1352
- $t as InteractionActionType,
1353
- H as InteractionObsType,
1354
- w as InteractionType,
1355
- f as Node,
1389
+ W as AnimationPlayer,
1390
+ as as ComponentFlowParser,
1391
+ Os as ComponentTrigger,
1392
+ ns as FlowParser,
1393
+ $ as InteractionAction,
1394
+ hs as InteractionActionType,
1395
+ j as InteractionObsType,
1396
+ L as InteractionType,
1397
+ A as Node,
1356
1398
  n as NodePropTypeEnum,
1357
1399
  r as NodeTypeEnum,
1358
- Yt as Trigger
1400
+ ls as Trigger
1359
1401
  };