@caperjs/core 0.2.4 → 0.3.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.
Files changed (172) hide show
  1. package/build/index.mjs +3 -1
  2. package/build/internal/discovery.mjs +1 -1
  3. package/build/internal/manifest.mjs +8 -3
  4. package/build/internal/validate.mjs +3 -1
  5. package/build/plugins/assetTypes.mjs +4 -4
  6. package/build/plugins/caperConfig.mjs +12 -5
  7. package/build/plugins/lists.mjs +29 -9
  8. package/cli/create.mjs +57 -6
  9. package/cli/create.test.mjs +36 -0
  10. package/cli/update.mjs +1 -1
  11. package/lib/{CaptionsPlugin-WPAcfAkx.js → CaptionsPlugin-BLbLl3WB.js} +3 -3
  12. package/lib/{CaptionsPlugin-WPAcfAkx.js.map → CaptionsPlugin-BLbLl3WB.js.map} +1 -1
  13. package/lib/{DataAdapter-DS-twowe.js → DataAdapter-aHSNM_26.js} +12 -7
  14. package/lib/DataAdapter-aHSNM_26.js.map +1 -0
  15. package/lib/{DebugRenderer-D1ryrRYx.js → DebugRenderer-8LjHtBzA.js} +2 -2
  16. package/lib/{DebugRenderer-D1ryrRYx.js.map → DebugRenderer-8LjHtBzA.js.map} +1 -1
  17. package/lib/{DevToolsPlugin-DH7zX7HU.js → DevToolsPlugin-Vrk6aOtS.js} +2 -2
  18. package/lib/{DevToolsPlugin-DH7zX7HU.js.map → DevToolsPlugin-Vrk6aOtS.js.map} +1 -1
  19. package/lib/{GSAPPlugin-BBtRjUqe.js → GSAPPlugin-Hm3F4zdg.js} +3 -3
  20. package/lib/{GSAPPlugin-BBtRjUqe.js.map → GSAPPlugin-Hm3F4zdg.js.map} +1 -1
  21. package/lib/{LayoutPlugin-Co6vcoV4.js → LayoutPlugin-Dpgeawfw.js} +4 -4
  22. package/lib/{LayoutPlugin-Co6vcoV4.js.map → LayoutPlugin-Dpgeawfw.js.map} +1 -1
  23. package/lib/{SpinePlugin-uN641Hmk.js → SpinePlugin-B08yAw1S.js} +690 -793
  24. package/lib/SpinePlugin-B08yAw1S.js.map +1 -0
  25. package/lib/{StatsPlugin-vZQRm6wh.js → StatsPlugin-D2Xa5j97.js} +5 -2
  26. package/lib/StatsPlugin-D2Xa5j97.js.map +1 -0
  27. package/lib/{VoiceOverPlugin-KlZdGj1G.js → VoiceOverPlugin-qtFlqpRn.js} +6 -5
  28. package/lib/VoiceOverPlugin-qtFlqpRn.js.map +1 -0
  29. package/lib/caper.mjs +23 -10
  30. package/lib/caper.mjs.map +1 -1
  31. package/lib/core/Application.d.ts +8 -3
  32. package/lib/core/Application.d.ts.map +1 -1
  33. package/lib/core/Application.test.d.ts +2 -0
  34. package/lib/core/Application.test.d.ts.map +1 -0
  35. package/lib/core/config.d.ts +6 -1
  36. package/lib/core/config.d.ts.map +1 -1
  37. package/lib/core/config.test.d.ts +2 -0
  38. package/lib/core/config.test.d.ts.map +1 -0
  39. package/lib/core/interfaces/IApplication.d.ts +6 -6
  40. package/lib/core/interfaces/IApplication.d.ts.map +1 -1
  41. package/lib/core/interfaces/ICoreSignals.d.ts +2 -1
  42. package/lib/core/interfaces/ICoreSignals.d.ts.map +1 -1
  43. package/lib/display/Camera.test.d.ts +2 -0
  44. package/lib/display/Camera.test.d.ts.map +1 -0
  45. package/lib/display/Entity.d.ts +2 -2
  46. package/lib/display/SceneTransition.test.d.ts +1 -0
  47. package/lib/display/SceneTransition.test.d.ts.map +1 -0
  48. package/lib/display/SpineAnimation.d.ts +3 -3
  49. package/lib/mixins/factory/methods.d.ts.map +1 -1
  50. package/lib/plugins/AssetsPlugin.d.ts.map +1 -1
  51. package/lib/plugins/AssetsPlugin.test.d.ts +2 -0
  52. package/lib/plugins/AssetsPlugin.test.d.ts.map +1 -0
  53. package/lib/plugins/DataAdapter.d.ts.map +1 -1
  54. package/lib/plugins/DataAdapter.test.d.ts +2 -0
  55. package/lib/plugins/DataAdapter.test.d.ts.map +1 -0
  56. package/lib/plugins/FullScreenPlugin.d.ts.map +1 -1
  57. package/lib/plugins/FullScreenPlugin.test.d.ts +2 -0
  58. package/lib/plugins/FullScreenPlugin.test.d.ts.map +1 -0
  59. package/lib/plugins/GSAPPlugin.d.ts +0 -2
  60. package/lib/plugins/GSAPPlugin.d.ts.map +1 -1
  61. package/lib/plugins/GSAPPlugin.test.d.ts +2 -0
  62. package/lib/plugins/GSAPPlugin.test.d.ts.map +1 -0
  63. package/lib/plugins/LookupPlugin.d.ts +6 -1
  64. package/lib/plugins/LookupPlugin.d.ts.map +1 -1
  65. package/lib/plugins/LookupPlugin.test.d.ts +2 -0
  66. package/lib/plugins/LookupPlugin.test.d.ts.map +1 -0
  67. package/lib/plugins/PopupManagerPlugin.d.ts.map +1 -1
  68. package/lib/plugins/PopupManagerPlugin.test.d.ts +1 -0
  69. package/lib/plugins/PopupManagerPlugin.test.d.ts.map +1 -0
  70. package/lib/plugins/SceneManagerPlugin.d.ts +1 -0
  71. package/lib/plugins/SceneManagerPlugin.d.ts.map +1 -1
  72. package/lib/plugins/SceneManagerPlugin.test.d.ts +2 -0
  73. package/lib/plugins/SceneManagerPlugin.test.d.ts.map +1 -0
  74. package/lib/plugins/StatsPlugin.d.ts +1 -0
  75. package/lib/plugins/StatsPlugin.d.ts.map +1 -1
  76. package/lib/plugins/WebEventsPlugin.d.ts.map +1 -1
  77. package/lib/plugins/actions/ActionsPlugin.test.d.ts +2 -0
  78. package/lib/plugins/actions/ActionsPlugin.test.d.ts.map +1 -0
  79. package/lib/plugins/audio/AudioChannel.d.ts.map +1 -1
  80. package/lib/plugins/audio/AudioManagerPlugin.d.ts.map +1 -1
  81. package/lib/plugins/audio/AudioManagerPlugin.test.d.ts +2 -0
  82. package/lib/plugins/audio/AudioManagerPlugin.test.d.ts.map +1 -0
  83. package/lib/plugins/audio/VoiceOverPlugin.d.ts.map +1 -1
  84. package/lib/plugins/captions/CaptionsPlugin.test.d.ts +2 -0
  85. package/lib/plugins/captions/CaptionsPlugin.test.d.ts.map +1 -0
  86. package/lib/plugins/focus/FocusManagerPlugin.d.ts.map +1 -1
  87. package/lib/plugins/focus/FocusManagerPlugin.test.d.ts +2 -0
  88. package/lib/plugins/focus/FocusManagerPlugin.test.d.ts.map +1 -0
  89. package/lib/plugins/input/AbstractControls.d.ts +5 -0
  90. package/lib/plugins/input/AbstractControls.d.ts.map +1 -1
  91. package/lib/plugins/input/Controls.test.d.ts +2 -0
  92. package/lib/plugins/input/Controls.test.d.ts.map +1 -0
  93. package/lib/plugins/input/keyboard/KeyboardContols.d.ts +5 -0
  94. package/lib/plugins/input/keyboard/KeyboardContols.d.ts.map +1 -1
  95. package/lib/plugins/input/touch/VirtualControls.d.ts +6 -0
  96. package/lib/plugins/input/touch/VirtualControls.d.ts.map +1 -1
  97. package/lib/plugins/input/touch/VirtualControls.test.d.ts +2 -0
  98. package/lib/plugins/input/touch/VirtualControls.test.d.ts.map +1 -0
  99. package/lib/{registries-BLrxALZ0.js → registries-m2vKTIih.js} +156 -101
  100. package/lib/registries-m2vKTIih.js.map +1 -0
  101. package/lib/store/Store.d.ts.map +1 -1
  102. package/lib/ui/Button.d.ts.map +1 -1
  103. package/lib/ui/UICanvas.d.ts +10 -1
  104. package/lib/ui/UICanvas.d.ts.map +1 -1
  105. package/lib/ui/UICanvas.test.d.ts +0 -1
  106. package/lib/ui/UICanvas.test.d.ts.map +1 -1
  107. package/lib/utils/color.d.ts.map +1 -1
  108. package/lib/utils/color.test.d.ts +2 -0
  109. package/lib/utils/color.test.d.ts.map +1 -0
  110. package/package.json +1 -1
  111. package/src/core/Application.test.ts +168 -0
  112. package/src/core/Application.ts +37 -27
  113. package/src/core/config.test.ts +79 -0
  114. package/src/core/config.ts +28 -6
  115. package/src/core/interfaces/IApplication.ts +6 -6
  116. package/src/core/interfaces/ICoreSignals.ts +2 -0
  117. package/src/display/Camera.test.ts +40 -0
  118. package/src/display/Camera.ts +3 -3
  119. package/src/display/Entity.ts +2 -2
  120. package/src/display/SceneTransition.test.ts +58 -0
  121. package/src/display/SceneTransition.ts +1 -1
  122. package/src/display/SpineAnimation.ts +4 -4
  123. package/src/mixins/factory/methods.ts +0 -1
  124. package/src/plugins/AssetsPlugin.test.ts +48 -0
  125. package/src/plugins/AssetsPlugin.ts +3 -1
  126. package/src/plugins/DataAdapter.test.ts +32 -0
  127. package/src/plugins/DataAdapter.ts +5 -1
  128. package/src/plugins/FullScreenPlugin.test.ts +48 -0
  129. package/src/plugins/FullScreenPlugin.ts +5 -1
  130. package/src/plugins/GSAPPlugin.test.ts +31 -0
  131. package/src/plugins/GSAPPlugin.ts +1 -4
  132. package/src/plugins/LookupPlugin.test.ts +42 -0
  133. package/src/plugins/LookupPlugin.ts +15 -3
  134. package/src/plugins/PopupManagerPlugin.test.ts +53 -0
  135. package/src/plugins/PopupManagerPlugin.ts +5 -3
  136. package/src/plugins/SceneManagerPlugin.test.ts +76 -0
  137. package/src/plugins/SceneManagerPlugin.ts +21 -11
  138. package/src/plugins/StatsPlugin.ts +8 -0
  139. package/src/plugins/WebEventsPlugin.test.ts +32 -0
  140. package/src/plugins/WebEventsPlugin.ts +2 -0
  141. package/src/plugins/actions/ActionsPlugin.test.ts +68 -0
  142. package/src/plugins/actions/ActionsPlugin.ts +5 -5
  143. package/src/plugins/audio/AudioChannel.test.ts +19 -0
  144. package/src/plugins/audio/AudioChannel.ts +8 -1
  145. package/src/plugins/audio/AudioManagerPlugin.test.ts +41 -0
  146. package/src/plugins/audio/AudioManagerPlugin.ts +3 -2
  147. package/src/plugins/audio/VoiceOverPlugin.ts +1 -0
  148. package/src/plugins/captions/CaptionsPlugin.test.ts +40 -0
  149. package/src/plugins/captions/CaptionsPlugin.ts +1 -1
  150. package/src/plugins/focus/FocusManagerPlugin.test.ts +71 -0
  151. package/src/plugins/focus/FocusManagerPlugin.ts +7 -0
  152. package/src/plugins/input/AbstractControls.ts +6 -0
  153. package/src/plugins/input/Controls.test.ts +149 -0
  154. package/src/plugins/input/keyboard/KeyboardContols.ts +29 -5
  155. package/src/plugins/input/touch/VirtualControls.test.ts +38 -0
  156. package/src/plugins/input/touch/VirtualControls.ts +44 -10
  157. package/src/plugins/spine/SpinePlugin.ts +2 -2
  158. package/src/store/Store.test.ts +15 -0
  159. package/src/store/Store.ts +4 -1
  160. package/src/ui/Button.test.ts +12 -0
  161. package/src/ui/Button.ts +1 -0
  162. package/src/ui/UICanvas.test.ts +109 -6
  163. package/src/ui/UICanvas.ts +41 -3
  164. package/src/utils/color.test.ts +16 -0
  165. package/src/utils/color.ts +2 -1
  166. package/src/utils/platform.ts +1 -1
  167. package/src/version.ts +1 -1
  168. package/lib/DataAdapter-DS-twowe.js.map +0 -1
  169. package/lib/SpinePlugin-uN641Hmk.js.map +0 -1
  170. package/lib/StatsPlugin-vZQRm6wh.js.map +0 -1
  171. package/lib/VoiceOverPlugin-KlZdGj1G.js.map +0 -1
  172. package/lib/registries-BLrxALZ0.js.map +0 -1
@@ -325,62 +325,63 @@ function qe() {
325
325
  //#endregion
326
326
  //#region src/core/config.ts
327
327
  async function Je(e) {
328
- let t = Caper.get("pluginsList") || [];
328
+ let t = globalThis.Caper?.get?.("pluginsList") ?? [];
329
329
  return e.map((e) => {
330
- let n = t.find((t) => t.id === e || t.id === e[0]);
331
- if (!n) return S.warn(`Plugin ${e} not found`), null;
332
- let r = e;
330
+ let n = Array.isArray(e) ? e[0] : e, r = t.find((e) => e.id === n);
331
+ if (!r) return S.warn(`Plugin ${e} not found`), null;
332
+ let i = e;
333
333
  return {
334
- id: n.id,
335
- path: n.path,
336
- module: n.module,
337
- requires: n.requires ?? [],
338
- options: r[1]?.options,
339
- autoLoad: r[1]?.autoLoad !== !1
334
+ id: r.id,
335
+ path: r.path,
336
+ module: r.module,
337
+ requires: r.requires ?? [],
338
+ options: i[1]?.options,
339
+ autoLoad: i[1]?.autoLoad !== !1
340
340
  };
341
341
  }).filter(Boolean);
342
342
  }
343
343
  function Ye(e) {
344
344
  return e;
345
345
  }
346
- function Xe(e) {
346
+ function Xe(e, t) {
347
347
  if (e.length < 2) return e.slice();
348
- let t = /* @__PURE__ */ new Map();
349
- for (let n of e) t.set(n.id, n);
350
- let n = [];
351
- for (let r of e) for (let e of r.requires ?? []) t.has(e) || n.push({
352
- from: r.id,
348
+ let n = /* @__PURE__ */ new Map();
349
+ for (let t of e) n.set(t.id, t);
350
+ let r = (e) => (e.requires ?? []).filter((e) => n.has(e) || !t?.has(e)), i = [];
351
+ for (let t of e) for (let e of r(t)) n.has(e) || i.push({
352
+ from: t.id,
353
353
  required: e
354
354
  });
355
- if (n.length > 0) {
356
- let e = n.map((e) => ` - Plugin '${e.from}' requires '${e.required}' which is not registered.`), t = "\nAdd the missing plugin id(s) to plugins[] in caper.config.ts:\n " + [...new Set(n.map((e) => `'${e.required}'`))].join(", ");
355
+ if (i.length > 0) {
356
+ let e = i.map((e) => ` - Plugin '${e.from}' requires '${e.required}' which is not registered.`), t = "\nAdd the missing plugin id(s) to plugins[] in caper.config.ts:\n " + [...new Set(i.map((e) => `'${e.required}'`))].join(", ");
357
357
  throw Error(`Caper bootstrap failed:\n${e.join("\n")}${t}`);
358
358
  }
359
- let r = /* @__PURE__ */ new Map();
360
- e.forEach((e, t) => r.set(e.id, t));
361
- let i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
359
+ let a = /* @__PURE__ */ new Map();
360
+ e.forEach((e, t) => a.set(e.id, t));
361
+ let o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
362
362
  for (let t of e) {
363
- i.set(t.id, (t.requires ?? []).length);
364
- for (let e of t.requires ?? []) a.has(e) || a.set(e, []), a.get(e).push(t.id);
365
- }
366
- let o = [];
367
- for (let t of e) i.get(t.id) === 0 && o.push(t.id);
368
- o.sort((e, t) => r.get(e) - r.get(t));
369
- let s = [];
370
- for (; o.length > 0;) {
371
- let e = o.shift();
372
- s.push(t.get(e));
373
- for (let t of a.get(e) ?? []) if (i.set(t, i.get(t) - 1), i.get(t) === 0) {
374
- let e = r.get(t), n = 0;
375
- for (; n < o.length && r.get(o[n]) < e;) n++;
376
- o.splice(n, 0, t);
377
- }
378
- }
379
- if (s.length !== e.length) {
380
- let n = e.filter((e) => !s.includes(e)).map((e) => e.id), r = Ze(n, t);
381
- throw Error(`Caper bootstrap failed: plugin dependency cycle detected: ${r.join(" ")}\nPlugins involved: ${n.join(", ")}`);
382
- }
383
- return s;
363
+ let e = r(t);
364
+ o.set(t.id, e.length);
365
+ for (let n of e) s.has(n) || s.set(n, []), s.get(n).push(t.id);
366
+ }
367
+ let c = [];
368
+ for (let t of e) o.get(t.id) === 0 && c.push(t.id);
369
+ c.sort((e, t) => a.get(e) - a.get(t));
370
+ let l = [];
371
+ for (; c.length > 0;) {
372
+ let e = c.shift();
373
+ l.push(n.get(e));
374
+ for (let t of s.get(e) ?? []) if (o.set(t, o.get(t) - 1), o.get(t) === 0) {
375
+ let e = a.get(t), n = 0;
376
+ for (; n < c.length && a.get(c[n]) < e;) n++;
377
+ c.splice(n, 0, t);
378
+ }
379
+ }
380
+ if (l.length !== e.length) {
381
+ let t = e.filter((e) => !l.includes(e)).map((e) => e.id), r = Ze(t, n);
382
+ throw Error(`Caper bootstrap failed: plugin dependency cycle detected: ${r.join(" → ")}\nPlugins involved: ${t.join(", ")}`);
383
+ }
384
+ return l;
384
385
  }
385
386
  function Ze(e, t) {
386
387
  let n = /* @__PURE__ */ new Set(), r = [], i = new Set(e);
@@ -693,7 +694,7 @@ var O = /* @__PURE__ */ h(((e) => {
693
694
  }
694
695
  async save(e, t, n, r = !0) {
695
696
  let i = [], a = [];
696
- i = Array.isArray(e) ? e : [e], (i[0] === "*" || i[0]?.adapterId === "*") && (i = this.allAdapterIds());
697
+ i = Array.isArray(e) ? e : [e], i.some((e) => e === "*" || e?.adapterId === "*") && (i = this.allAdapterIds());
697
698
  for (let e = 0; e < i.length; e++) {
698
699
  let o, s = !1;
699
700
  if (typeof i[e] == "object") {
@@ -798,13 +799,13 @@ var M = class {
798
799
  registerCoreFunctions() {
799
800
  this.getCoreFunctions().forEach((e) => {
800
801
  let t = e;
801
- Bn[t] = this[e];
802
+ Vn[t] = this[e];
802
803
  });
803
804
  }
804
805
  registerCoreSignals() {
805
806
  this.getCoreSignals().forEach((e) => {
806
807
  let t = e;
807
- zn[t] = this[e];
808
+ Bn[t] = this[e];
808
809
  });
809
810
  }
810
811
  getCoreFunctions() {
@@ -866,7 +867,7 @@ var pt = class extends M {
866
867
  async loadRequired() {
867
868
  if (this._isLoadingRequired = !0, this._handleLoadStart(), this._handleLoadProgress(0), this._required && (this._required.assets && await t.load(N(this._required.assets), this._handleLoadProgress), this._required.bundles)) {
868
869
  let e = this._required.bundles;
869
- Array.isArray(e) || (e = [e]), e = e.filter((e) => !this._isBundleLoaded(e)), await t.loadBundle(this._required.bundles, this._handleLoadProgress);
870
+ Array.isArray(e) || (e = [e]), e = e.filter((e) => !this._isBundleLoaded(e)), e.length && await t.loadBundle(e, this._handleLoadProgress);
870
871
  }
871
872
  return this._handleLoadComplete(), this._isLoadingRequired = !1, Promise.resolve();
872
873
  }
@@ -1025,7 +1026,7 @@ var pt = class extends M {
1025
1026
  document.addEventListener("fullscreenchange", this._onFullScreenChange), document.addEventListener("webkitfullscreenchange", this._onFullScreenChange), document.addEventListener("mozfullscreenchange", this._onFullScreenChange), document.addEventListener("msfullscreenchange", this._onFullScreenChange), document.addEventListener("fullscreenchange", this._onFullScreenChange);
1026
1027
  }
1027
1028
  destroy() {
1028
- document.removeEventListener("fullscreenchange", this._onFullScreenChange), document.removeEventListener("webkitfullscreenchange", this._onFullScreenChange), document.removeEventListener("mozfullscreenchange", this._onFullScreenChange), document.removeEventListener("msfullscreenchange", this._onFullScreenChange), document.removeEventListener("fullscreenchange", this._onFullScreenChange);
1029
+ document.removeEventListener("fullscreenchange", this._onFullScreenChange), document.removeEventListener("webkitfullscreenchange", this._onFullScreenChange), document.removeEventListener("mozfullscreenchange", this._onFullScreenChange), document.removeEventListener("msfullscreenchange", this._onFullScreenChange), document.removeEventListener("fullscreenchange", this._onFullScreenChange), super.destroy();
1029
1030
  }
1030
1031
  toggleFullScreen() {
1031
1032
  this.setFullScreen(!this._isFullScreen);
@@ -1069,7 +1070,7 @@ var pt = class extends M {
1069
1070
  document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen && document.mozCancelFullScreen();
1070
1071
  }
1071
1072
  _onFullScreenChange() {
1072
- this.onFullScreenChange.emit(document.fullscreenElement !== null);
1073
+ this._isFullScreen = this.isFullscreen, this.onFullScreenChange.emit(this._isFullScreen);
1073
1074
  }
1074
1075
  };
1075
1076
  //#endregion
@@ -1178,7 +1179,8 @@ var ht = class extends M {
1178
1179
  this._debug && S.warn(`Action ${e} is not defined`);
1179
1180
  return;
1180
1181
  }
1181
- if (this._actions[e]?.context === "*" || this._actions[e]?.context === this.context || this._actions[e]?.context?.includes(this.context)) {
1182
+ let n = this._actions[e].context;
1183
+ if (Array.isArray(n) ? n.includes(this.context) : n === this.context || n === "*") {
1182
1184
  let n = {
1183
1185
  id: e,
1184
1186
  context: this.context,
@@ -1578,7 +1580,11 @@ var L = {
1578
1580
  restore() {
1579
1581
  this.muted = this._muted, this.volume = this._volume;
1580
1582
  }
1581
- destroy() {}
1583
+ destroy() {
1584
+ this._sounds.forEach((e) => {
1585
+ [...e].forEach((e) => e.destroy());
1586
+ }), this._sounds.clear();
1587
+ }
1582
1588
  }, z = class {
1583
1589
  constructor(e, t, n) {
1584
1590
  this.id = e, this.channel = t, this.manager = n, this.onStart = new A(), this.onStop = new A(), this.onEnd = new A(), this.onPaused = new A(), this.onResumed = new A(), this.onProgress = new A(), this._volume = 1, this._muted = !1, this._isPlaying = !1, g(this), this.muted = this.channel.muted;
@@ -2834,7 +2840,7 @@ var en = class extends M {
2834
2840
  destroy() {
2835
2841
  this._channels.forEach((e) => {
2836
2842
  e.destroy();
2837
- }), this._channels.clear(), this.onSoundStarted.disconnectAll(), this.onSoundEnded.disconnectAll(), this.onMuted.disconnectAll(), this.onMasterVolumeChanged.disconnectAll(), this.onChannelVolumeChanged.disconnectAll(), super.destroy();
2843
+ }), this._channels.clear(), this.onSoundStarted.disconnectAll(), this.onSoundEnded.disconnectAll(), this.onMuted.disconnectAll(), this.onMasterVolumeChanged.disconnectAll(), this.onChannelVolumeChanged.disconnectAll(), this.onChannelMuted.disconnectAll(), super.destroy();
2838
2844
  }
2839
2845
  initialize(e, t) {
2840
2846
  return J.disableAutoPause = !0, typeof t?.manifest == "object" && this.addAllFromManifest(t.manifest), Promise.resolve();
@@ -2988,17 +2994,17 @@ var en = class extends M {
2988
2994
  load(e, t = "sfx", n) {
2989
2995
  Array.isArray(e) || (e = [e]);
2990
2996
  for (let r of e) {
2991
- this._idMap.has(r) && (e = this._idMap.get(r));
2992
- let i = this._channels.get(t);
2993
- if (i) {
2997
+ this._idMap.has(r) && (r = this._idMap.get(r));
2998
+ let e = this._channels.get(t);
2999
+ if (e) {
2994
3000
  r = this._verifySoundId(r);
2995
- let e = J.find(r);
2996
- e.options = {
3001
+ let t = J.find(r);
3002
+ t.options = {
2997
3003
  ...n,
2998
3004
  autoPlay: !1
2999
3005
  };
3000
- let t = i.add(r, new z(r, i, this));
3001
- t.media = e.instances[0], t.pause();
3006
+ let i = e.add(r, new z(r, e, this));
3007
+ i.media = t.instances[0], i.pause();
3002
3008
  } else throw Error(`Channel ${t} does not exist.`);
3003
3009
  }
3004
3010
  }
@@ -3043,7 +3049,7 @@ var en = class extends M {
3043
3049
  if (r ||= (e = n + ".mp3", t.get(e)), r ||= (e = n + ".ogg", t.get(e)), r ||= (e = n + ".wav", t.get(e)), r) this._findAndAddFromManifest(e, r);
3044
3050
  else throw Error(`Sound with ID ${e} does not exist.`);
3045
3051
  }
3046
- return this._idMap.set(e, e), e;
3052
+ return this._idMap.set(n, e), e;
3047
3053
  }
3048
3054
  _findAndAddFromManifest(e, t) {
3049
3055
  let n = this.app.manifest;
@@ -3391,7 +3397,7 @@ var en = class extends M {
3391
3397
  globalThis.document.addEventListener("mousemove", this._handleGlobalMouseMove), globalThis.document.addEventListener("pointerdown", this._handleGlobalPointerDown);
3392
3398
  }
3393
3399
  _removeGlobalListeners() {
3394
- globalThis.document.removeEventListener("mousemove", this._handleGlobalMouseMove), globalThis.document.removeEventListener("pointerdown", this._handleGlobalPointerDown);
3400
+ globalThis.document.removeEventListener("mousemove", this._handleGlobalMouseMove), globalThis.document.removeEventListener("pointerdown", this._handleGlobalPointerDown), window.removeEventListener("keydown", this._onKeyDown, !1), globalThis.removeEventListener("keydown", this._onKeyDown, !1), globalThis.removeEventListener("keyup", this._onKeyUp, !1), globalThis.document.removeEventListener("mousemove", this._onMouseMove, !0);
3395
3401
  }
3396
3402
  _handleGlobalMouseMove() {
3397
3403
  this._enabled && this._active && this.deactivate();
@@ -3653,16 +3659,17 @@ var pn = class {
3653
3659
  initialize(e) {
3654
3660
  this.scheme = e;
3655
3661
  }
3662
+ destroy() {}
3656
3663
  }, mn = class extends Z(pn) {
3657
3664
  constructor() {
3658
- super(), this._keyCombinations = [], this._singleDownKeys = /* @__PURE__ */ new Set(), this._keyCombinationsMap = /* @__PURE__ */ new Map(), this._activeDownKeys = /* @__PURE__ */ new Map(), this._activeUpKeys = /* @__PURE__ */ new Map(), g(this);
3665
+ super(), this._keyCombinations = [], this._singleDownKeys = /* @__PURE__ */ new Set(), this._keyCombinationsMap = /* @__PURE__ */ new Map(), this._activeDownKeys = /* @__PURE__ */ new Map(), this._activeUpKeys = /* @__PURE__ */ new Map(), this._warnedMissingActions = /* @__PURE__ */ new Set(), g(this);
3659
3666
  }
3660
3667
  get app() {
3661
3668
  return $.getInstance();
3662
3669
  }
3663
3670
  isActionActive(e) {
3664
3671
  let t = this.scheme.down?.[e] ?? null;
3665
- return t ? Array.isArray(t) ? this._keyCombinationsMap.has(t) || t.some((e) => this._singleDownKeys.has(e)) : this._singleDownKeys.has(t) : !1;
3672
+ return t ? Array.isArray(t) ? t.some((e) => this._isInputActive(e)) : this._isInputActive(t) : !1;
3666
3673
  }
3667
3674
  initialize(e) {
3668
3675
  super.initialize(e), this._keyDownMap = e.down || {}, this._keyUpMap = e.up || {}, this._sortActions();
@@ -3670,12 +3677,25 @@ var pn = class {
3670
3677
  connect() {
3671
3678
  this.addSignalConnection(this.app.signal.onActionContextChanged.connect(this._handleContextChanged), this.app.keyboard.onKeyDown().connect(this._handleKeyDown), this.app.keyboard.onKeyUp().connect(this._handleKeyUp)), this._handleContextChanged(), this.app.ticker.add(this._update);
3672
3679
  }
3680
+ destroy() {
3681
+ this.app.ticker.remove(this._update), super.destroy();
3682
+ }
3683
+ _isInputActive(e) {
3684
+ return e.includes("+") ? e.split("+").every((e) => this._singleDownKeys.has(e)) : this._singleDownKeys.has(e);
3685
+ }
3686
+ _warnMissingAction(e) {
3687
+ this._warnedMissingActions.has(e) || (this._warnedMissingActions.add(e), S.warn(`KeyboardControls: scheme references unknown action "${e}"`));
3688
+ }
3673
3689
  _sortActions() {
3674
3690
  let e = this.app.actionsPlugin.getActions();
3675
3691
  this._keyCombinations = [], this._keyCombinationsMap.clear(), this._activeDownKeys.clear(), this._activeUpKeys.clear();
3676
3692
  let t = Object.keys(this._keyDownMap);
3677
3693
  t.forEach((t) => {
3678
3694
  let n = this._keyDownMap[t], r = e[t];
3695
+ if (!r) {
3696
+ this._warnMissingAction(t);
3697
+ return;
3698
+ }
3679
3699
  if (r.context !== "*" && r.context !== this.app.actionContext && !r.context.includes(this.app.actionContext)) return;
3680
3700
  let i = n;
3681
3701
  i && (Array.isArray(i) || (i = [i]), i.forEach((e) => {
@@ -3741,7 +3761,7 @@ var pn = class {
3741
3761
  }
3742
3762
  }, hn = class extends Z(pn) {
3743
3763
  constructor() {
3744
- super(), this._buttons = /* @__PURE__ */ new Set(), this._combinations = [], this._singleDownButtons = /* @__PURE__ */ new Set(), this._activeJoystickDirections = /* @__PURE__ */ new Map(), this._activeButtonDownIds = /* @__PURE__ */ new Map(), this._activeButtonUpIds = /* @__PURE__ */ new Map(), this._combinationsMap = /* @__PURE__ */ new Map(), g(this);
3764
+ super(), this._buttons = /* @__PURE__ */ new Set(), this._combinations = [], this._singleDownButtons = /* @__PURE__ */ new Set(), this._activeJoystickDirections = /* @__PURE__ */ new Map(), this._activeButtonDownIds = /* @__PURE__ */ new Map(), this._activeButtonUpIds = /* @__PURE__ */ new Map(), this._combinationsMap = /* @__PURE__ */ new Map(), this._buttonConnections = /* @__PURE__ */ new Map(), this._warnedMissingActions = /* @__PURE__ */ new Set(), g(this);
3745
3765
  }
3746
3766
  get joystick() {
3747
3767
  return this._joystick;
@@ -3753,32 +3773,52 @@ var pn = class {
3753
3773
  return $.getInstance();
3754
3774
  }
3755
3775
  addButton(e) {
3756
- !e || this._buttons.has(e) || (this.addSignalConnection(e.onDown.connect(() => this._handleButtonDown(e)), e.onUp.connect(() => this._handleButtonUp(e)), e.onUpOutside.connect(() => this._handleButtonUp(e)), e.onDestroy.connect(() => this.removeButton(e))), this._buttons.add(e));
3776
+ if (!e || this._buttons.has(e)) return;
3777
+ let t = [
3778
+ e.onDown.connect(() => this._handleButtonDown(e)),
3779
+ e.onUp.connect(() => this._handleButtonUp(e)),
3780
+ e.onUpOutside.connect(() => this._handleButtonUp(e)),
3781
+ e.onDestroy.connect(() => this.removeButton(e))
3782
+ ];
3783
+ this.addSignalConnection(...t), this._buttonConnections.set(e, t), this._buttons.add(e);
3757
3784
  }
3758
3785
  removeButton(e) {
3759
- !e || !this._buttons.has(e) || (e.onDown.disconnect(() => this._handleButtonDown(e)), e.onUp.disconnect(() => this._handleButtonUp(e)), e.onUpOutside.disconnect(() => this._handleButtonUp(e)), e.onDestroy.disconnect(() => this.removeButton(e)), this._buttons.delete(e));
3786
+ !e || !this._buttons.has(e) || (this._buttonConnections.get(e)?.forEach((e) => e.disconnect()), this._buttonConnections.delete(e), this._singleDownButtons.delete(e.id), this._buttons.delete(e));
3760
3787
  }
3761
3788
  initialize(e) {
3762
- super.initialize(e), this._buttonDownMap = e.down || {}, this._buttonUpMap = e.up || {}, this._joystickMap = e.joystick || {}, this.app.signal.onActionContextChanged.connect(this._sortActions), this._sortActions();
3789
+ super.initialize(e), this._buttonDownMap = e.down || {}, this._buttonUpMap = e.up || {}, this._joystickMap = e.joystick || {}, this.addSignalConnection(this.app.signal.onActionContextChanged.connect(this._sortActions)), this._sortActions();
3763
3790
  }
3764
3791
  connect() {
3765
3792
  this.app.ticker.add(this._update);
3766
3793
  }
3794
+ destroy() {
3795
+ this.app.ticker.remove(this._update), super.destroy();
3796
+ }
3767
3797
  isActionActive(e) {
3768
3798
  let t = this.scheme.down?.[e] ?? null;
3769
- if (t) return Array.isArray(t) ? this._combinationsMap.has(t) : this._singleDownButtons.has(t);
3799
+ if (t) return Array.isArray(t) ? t.some((e) => this._isInputActive(e)) : this._isInputActive(t);
3770
3800
  {
3771
3801
  let t = this.scheme.joystick?.[e] ?? null;
3772
3802
  if (this._joystick && t) return Array.isArray(t) ? t.includes(this._joystick.direction) : t === this._joystick?.direction;
3773
3803
  }
3774
3804
  return !1;
3775
3805
  }
3806
+ _isInputActive(e) {
3807
+ return e.includes("+") ? e.split("+").every((e) => this._singleDownButtons.has(e) || this._joystick?.direction === e) : this._singleDownButtons.has(e);
3808
+ }
3809
+ _warnMissingAction(e) {
3810
+ this._warnedMissingActions.has(e) || (this._warnedMissingActions.add(e), S.warn(`VirtualControls: scheme references unknown action "${e}"`));
3811
+ }
3776
3812
  _sortActions() {
3777
3813
  let e = this.app.actionsPlugin.getActions();
3778
3814
  this._combinations = [], this._combinationsMap.clear(), this._activeJoystickDirections.clear(), this._activeButtonDownIds.clear(), this._activeButtonUpIds.clear();
3779
3815
  let t = Object.keys(this._buttonDownMap);
3780
3816
  t.forEach((t) => {
3781
3817
  let n = this._buttonDownMap[t], r = e[t];
3818
+ if (!r) {
3819
+ this._warnMissingAction(t);
3820
+ return;
3821
+ }
3782
3822
  if (r.context !== "*" && r.context !== this.app.actionContext && !r.context.includes(this.app.actionContext)) return;
3783
3823
  let i = n;
3784
3824
  i && (Array.isArray(i) || (i = [i]), i.forEach((e) => {
@@ -3789,6 +3829,10 @@ var pn = class {
3789
3829
  }));
3790
3830
  }), this._combinations.sort((e, t) => t.length - e.length), t = Object.keys(this._buttonUpMap), t.forEach((t) => {
3791
3831
  let n = this._buttonUpMap[t], r = e[t];
3832
+ if (!r) {
3833
+ this._warnMissingAction(t);
3834
+ return;
3835
+ }
3792
3836
  r.context !== "*" && r.context !== this.app.actionContext && !r.context.includes(this.app.actionContext) || this._activeButtonUpIds.set(n, t);
3793
3837
  }), Object.keys(this._joystickMap).forEach((e) => {
3794
3838
  let t = this._joystickMap[e];
@@ -4211,9 +4255,8 @@ var Sn = [
4211
4255
  });
4212
4256
  }
4213
4257
  removeAllPopups(e = !1) {
4214
- e ? this._activePopups.forEach((e) => {
4215
- e.hide();
4216
- }) : (this._activePopups.clear(), this.view.removeChildren());
4258
+ if (e) for (let e of [...this._activePopups.keys()]) this.hidePopup(e);
4259
+ else this._activePopups.clear(), this.view.removeChildren();
4217
4260
  }
4218
4261
  getCoreFunctions() {
4219
4262
  return [
@@ -4380,7 +4423,9 @@ var Sn = [
4380
4423
  setDefaultLoadMethod(e) {
4381
4424
  this._defaultLoadMethod = e;
4382
4425
  }
4383
- destroy() {}
4426
+ destroy() {
4427
+ window.removeEventListener("hashchange", this._onHashChange), this._debugMenu?.parentElement?.removeChild(this._debugMenu), super.destroy();
4428
+ }
4384
4429
  async initialize(e, t) {
4385
4430
  if (this._debugVisible = this.app.config?.showSceneDebugMenu === !0 || v && this.app.config?.showSceneDebugMenu !== !1, this._useHash = t.config?.useHash === !0 || this._debugVisible, this.view.sortableChildren = !0, this.list = (Caper.get("sceneList") || []).filter((e) => e.active !== !1), this.groupOrder = t.config?.sceneGroupOrder || [], (this._debugVisible || this._useHash) && (this.defaultScene = this.getSceneFromHash() || ""), !this.splash) {
4386
4431
  this.splash = {
@@ -4394,7 +4439,7 @@ var Sn = [
4394
4439
  };
4395
4440
  e.view && (this.splash.view = typeof e.view == "function" ? new e.view() : e.view), this.splash.preload = e.preload;
4396
4441
  }
4397
- return this.defaultScene = this.defaultScene || t.config?.defaultScene || this.list?.[0]?.id, !this.transition && t.config?.sceneTransition && (this.transition = typeof t.config.sceneTransition == "function" ? new t.config.sceneTransition() : t.config.sceneTransition), this._defaultLoadMethod = t.config.defaultSceneLoadMethod || "immediate", this._debugVisible && this._createDebugMenu(), this._useHash && this._listenForHashChange(), this.app.onPause.connect(this._onPause, "highest"), this.app.onResume.connect(this._onResume, "highest"), Promise.resolve(void 0);
4442
+ return this.defaultScene = this.defaultScene || t.config?.defaultScene || this.list?.[0]?.id, !this.transition && t.config?.sceneTransition && (this.transition = typeof t.config.sceneTransition == "function" ? new t.config.sceneTransition() : t.config.sceneTransition), this._defaultLoadMethod = t.config.defaultSceneLoadMethod || "immediate", this._debugVisible && this._createDebugMenu(), this._useHash && this._listenForHashChange(), this.addSignalConnection(this.app.onPause.connect(this._onPause, "highest"), this.app.onResume.connect(this._onResume, "highest")), Promise.resolve(void 0);
4398
4443
  }
4399
4444
  _onPause(e) {
4400
4445
  this.currentScene.onPause(e);
@@ -4451,10 +4496,11 @@ var Sn = [
4451
4496
  return ["loadScene"];
4452
4497
  }
4453
4498
  _listenForHashChange() {
4454
- window.addEventListener("hashchange", () => {
4455
- let e = this.getSceneFromHash();
4456
- e && this.loadScene(e);
4457
- });
4499
+ window.addEventListener("hashchange", this._onHashChange);
4500
+ }
4501
+ _onHashChange() {
4502
+ let e = this.getSceneFromHash();
4503
+ e && this.loadScene(e);
4458
4504
  }
4459
4505
  async _createCurrentScene() {
4460
4506
  let e = this.list.find((e) => e.id === this._currentSceneId), t;
@@ -4549,7 +4595,7 @@ var Sn = [
4549
4595
  }
4550
4596
  let t = e.target.value;
4551
4597
  t && (window.location.hash = t.toLowerCase());
4552
- }), this.onSceneChangeStart.connect(this._disableDebugMenu), this.onSceneChangeComplete.connect(this._enableDebugMenu);
4598
+ }), this.addSignalConnection(this.onSceneChangeStart.connect(this._disableDebugMenu), this.onSceneChangeComplete.connect(this._enableDebugMenu));
4553
4599
  }
4554
4600
  _enableDebugMenu() {
4555
4601
  this._debugMenu?.querySelector("select")?.removeAttribute("disabled");
@@ -4743,7 +4789,7 @@ var jn = class {
4743
4789
  document.addEventListener("visibilitychange", this._onVisibilityChanged, !1), window.addEventListener("pagehide", this._onPageHide, !1), window.addEventListener("pageshow", this._onPageShow, !1), window.addEventListener("resize", this._onResize), document.addEventListener("fullscreenchange", this._onResize), window.addEventListener("orientationchange", this._onOrientationChanged), window.visualViewport?.addEventListener("resize", this._onVisualViewportResize);
4744
4790
  }
4745
4791
  destroy() {
4746
- document.removeEventListener("visibilitychange", this._onVisibilityChanged, !1), window.removeEventListener("resize", this._onResize), document.removeEventListener("fullscreenchange", this._onResize), window.removeEventListener("pagehide", this._onPageHide, !1), window.removeEventListener("pageshow", this._onPageShow, !1), window.visualViewport?.removeEventListener("resize", this._onVisualViewportResize);
4792
+ document.removeEventListener("visibilitychange", this._onVisibilityChanged, !1), window.removeEventListener("resize", this._onResize), document.removeEventListener("fullscreenchange", this._onResize), window.removeEventListener("pagehide", this._onPageHide, !1), window.removeEventListener("pageshow", this._onPageShow, !1), window.removeEventListener("orientationchange", this._onOrientationChanged), window.visualViewport?.removeEventListener("resize", this._onVisualViewportResize), super.destroy();
4747
4793
  }
4748
4794
  getCoreSignals() {
4749
4795
  return ["onVisibilityChanged", "onOrientationChanged"];
@@ -4790,7 +4836,7 @@ var jn = class {
4790
4836
  constructor(...e) {
4791
4837
  super(...e), this.name = "lookup", this.pathToContainer = /* @__PURE__ */ new Map(), this.containerToPath = /* @__PURE__ */ new Map();
4792
4838
  }
4793
- get coreFunctions() {
4839
+ getCoreFunctions() {
4794
4840
  return [
4795
4841
  "getChildAtPath",
4796
4842
  "getPathForChild",
@@ -4800,7 +4846,10 @@ var jn = class {
4800
4846
  ];
4801
4847
  }
4802
4848
  async initialize() {
4803
- Q.onGlobalChildAdded.connect(this.onChildAdded), Q.onGlobalChildRemoved.connect(this.onChildRemoved);
4849
+ this.addSignalConnection(Q.onGlobalChildAdded.connect(this.onChildAdded), Q.onGlobalChildRemoved.connect(this.onChildRemoved));
4850
+ }
4851
+ destroy() {
4852
+ this.pathToContainer.clear(), this.containerToPath.clear(), super.destroy();
4804
4853
  }
4805
4854
  getChildAtPath(e) {
4806
4855
  return this.pathToContainer.get(e);
@@ -4978,6 +5027,11 @@ var Ln = {
4978
5027
  defaultSceneLoadMethod: "immediate",
4979
5028
  assets: { manifest: "./assets.json" }
4980
5029
  }, Rn = {
5030
+ pauseAudio: !0,
5031
+ pauseAnimations: !0,
5032
+ pauseTicker: !0,
5033
+ pauseTimers: !0
5034
+ }, zn = {
4981
5035
  pauseAudio: !1,
4982
5036
  pauseAnimations: !1,
4983
5037
  pauseTicker: !1,
@@ -5003,9 +5057,9 @@ var Ln = {
5003
5057
  }
5004
5058
  pause(e) {
5005
5059
  this._paused = !0, this._pauseConfig = {
5006
- ...Rn,
5060
+ ...e ? zn : Rn,
5007
5061
  ...e
5008
- }, e?.pauseAudio && this.audio.pause(), e?.pauseAnimations && p?.globalTimeline?.pause(), e?.pauseTicker && this.ticker.stop(), e?.pauseTimers && this.timers.pauseAllTimers(), e?.pauseOther && e.pauseOther.forEach((e) => {
5062
+ }, this._pauseConfig.pauseAudio && this.audio.pause(), this._pauseConfig.pauseAnimations && p?.globalTimeline?.pause(), this._pauseConfig.pauseTicker && this.ticker.stop(), this._pauseConfig.pauseTimers && this.timers.pauseAllTimers(), this._pauseConfig.pauseOther && this._pauseConfig.pauseOther.forEach((e) => {
5009
5063
  typeof e?.pause == "function" && e.pause();
5010
5064
  }), this.onPause.emit(this._pauseConfig);
5011
5065
  }
@@ -5018,7 +5072,7 @@ var Ln = {
5018
5072
  this._paused = !this._paused, this._paused ? this.pause(e) : this.resume();
5019
5073
  }
5020
5074
  constructor() {
5021
- super(), this.onPause = new A(), this.onResume = new A(), this.onResize = new A(), this.onPluginError = new A(), this.onPwaInstallAvailable = new A(), this.onPwaUpdateAvailable = new A(), this._plugins = /* @__PURE__ */ new Map(), this._isBooting = !0, this._env = {
5075
+ super(), this.onPause = new A(), this.onResume = new A(), this.onResize = new A(), this.onPluginError = new A(), this.onPwaInstallAvailable = new A(), this.onPwaUpdateAvailable = new A(), this._plugins = /* @__PURE__ */ new Map(), this._env = {
5022
5076
  BASE_URL: "/",
5023
5077
  DEV: !1,
5024
5078
  MODE: "production",
@@ -5170,19 +5224,20 @@ var Ln = {
5170
5224
  return "ontouchstart" in window || navigator.maxTouchPoints > 0;
5171
5225
  }
5172
5226
  get signal() {
5173
- return zn;
5227
+ return Bn;
5174
5228
  }
5175
5229
  get signals() {
5176
5230
  return this.signal;
5177
5231
  }
5178
5232
  get func() {
5179
- return Bn;
5233
+ return Vn;
5180
5234
  }
5181
5235
  get exec() {
5182
5236
  return this.func;
5183
5237
  }
5184
5238
  get views() {
5185
- return this._views || (this._views = [this.scenes.view, this.popups.view], this.scenes.splash.view && this._views.push(this.scenes.splash.view), this.scenes.transition && this._views.push(this.scenes.transition), this.captions?.view && this._views.push(this.captions.view)), this._views;
5239
+ let e = [this.scenes.view, this.popups.view];
5240
+ return this.scenes.splash.view && e.push(this.scenes.splash.view), this.scenes.transition && e.push(this.scenes.transition), this.captions?.view && e.push(this.captions.view), e;
5186
5241
  }
5187
5242
  static getInstance() {
5188
5243
  return r.instance || S.warn("Application not created yet"), r.instance;
@@ -5190,7 +5245,7 @@ var Ln = {
5190
5245
  destroy(e, t) {
5191
5246
  this._plugins.forEach((e) => {
5192
5247
  e.destroy();
5193
- }), this.store.destroy(), super.destroy(e, t);
5248
+ }), this.store?.destroy(), super.destroy(e, t);
5194
5249
  }
5195
5250
  setContainer(e) {
5196
5251
  r.containerElement = e;
@@ -5206,7 +5261,7 @@ var Ln = {
5206
5261
  ...this.config.defaultTextStyle
5207
5262
  }), this.config.defaultDropShadow && (l.defaultDropShadow = this.config.defaultDropShadow), t) t.appendChild(this.canvas), this.setContainer(t);
5208
5263
  else throw Error("No element found to append the view to.");
5209
- return await this.registerDefaultPlugins(), v && this.getPlugin("DevToolsPlugin").initializeDevTools(this), this.signals.onLoadRequiredComplete.connectOnce(this.requiredAssetsLoaded), await this._setup(), this.plugins = await Je(this.config.plugins || []), await this.registerPlugins(), await this.setup(), await this.loadDefaultScene(), this.renderer.canvas.focus(), this.config.container && this.config.container.classList.add("loaded"), this._isBooting = !1, r.instance;
5264
+ return await this.registerDefaultPlugins(), v && this.getPlugin("DevToolsPlugin").initializeDevTools(this), this.signals.onLoadRequiredComplete.connectOnce(this.requiredAssetsLoaded), await this._setup(), this.plugins = await Je(this.config.plugins || []), await this.registerPlugins(), await this.setup(), await this.loadDefaultScene(), this.renderer.canvas.focus(), this.config.container && this.config.container.classList.add("loaded"), r.instance;
5210
5265
  }
5211
5266
  getPlugin(e, t = !1) {
5212
5267
  let n = this._plugins.get(e);
@@ -5262,7 +5317,7 @@ var Ln = {
5262
5317
  this.sendAction(e, t);
5263
5318
  }
5264
5319
  isActionActive(e) {
5265
- return this.actionsPlugin.getActions()[e] !== void 0;
5320
+ return this.input.isActionActive(e);
5266
5321
  }
5267
5322
  get data() {
5268
5323
  return this.getPlugin("data");
@@ -5277,23 +5332,23 @@ var Ln = {
5277
5332
  let { id: t } = e;
5278
5333
  this._appName = t, v && await this.loadPlugin({
5279
5334
  id: "DevToolsPlugin",
5280
- module: () => import("./DevToolsPlugin-DH7zX7HU.js"),
5335
+ module: () => import("./DevToolsPlugin-Vrk6aOtS.js"),
5281
5336
  namedExport: "DevToolsPlugin"
5282
5337
  }), e.useLayout && await this.loadPlugin({
5283
5338
  id: "LayoutPlugin",
5284
- module: () => import("./LayoutPlugin-Co6vcoV4.js"),
5339
+ module: () => import("./LayoutPlugin-Dpgeawfw.js"),
5285
5340
  namedExport: "LayoutPlugin"
5286
5341
  }), await this.loadPlugin({
5287
5342
  id: "GSAPPlugin",
5288
- module: () => import("./GSAPPlugin-BBtRjUqe.js"),
5343
+ module: () => import("./GSAPPlugin-Hm3F4zdg.js"),
5289
5344
  namedExport: "GSAPPlugin"
5290
5345
  }), e.useSpine && await this.loadPlugin({
5291
5346
  id: "SpinePlugin",
5292
- module: () => import("./SpinePlugin-uN641Hmk.js"),
5347
+ module: () => import("./SpinePlugin-B08yAw1S.js"),
5293
5348
  namedExport: "SpinePlugin"
5294
5349
  }), this.config.useStore && (this._store = new st(), this._store.initialize(this), await this.loadPlugin({
5295
5350
  id: "data",
5296
- module: () => import("./DataAdapter-DS-twowe.js").then((e) => e.n),
5351
+ module: () => import("./DataAdapter-aHSNM_26.js").then((e) => e.n),
5297
5352
  namedExport: "DataAdapter",
5298
5353
  options: this.config.data
5299
5354
  }));
@@ -5322,23 +5377,23 @@ var Ln = {
5322
5377
  }
5323
5378
  (this.config.showStats === !0 || v && this.config.showStats !== !1) && await this.loadPlugin({
5324
5379
  id: "stats",
5325
- module: () => import("./StatsPlugin-vZQRm6wh.js"),
5380
+ module: () => import("./StatsPlugin-D2Xa5j97.js"),
5326
5381
  namedExport: "StatsPlugin"
5327
5382
  }), this.config.useVoiceover && (await this.loadPlugin({
5328
5383
  id: "voiceover",
5329
- module: () => import("./VoiceOverPlugin-KlZdGj1G.js"),
5384
+ module: () => import("./VoiceOverPlugin-qtFlqpRn.js"),
5330
5385
  namedExport: "VoiceOverPlugin",
5331
5386
  options: this.config.voiceover || void 0
5332
5387
  }), await this.loadPlugin({
5333
5388
  id: "captions",
5334
- module: () => import("./CaptionsPlugin-WPAcfAkx.js"),
5389
+ module: () => import("./CaptionsPlugin-BLbLl3WB.js"),
5335
5390
  namedExport: "CaptionsPlugin",
5336
5391
  options: this.config.captions || void 0
5337
5392
  }));
5338
5393
  }
5339
5394
  async registerPlugins() {
5340
5395
  if (!this.plugins?.length) return;
5341
- let e = Xe(this.plugins);
5396
+ let e = Xe(this.plugins, new Set(this._plugins.keys()));
5342
5397
  for (let t of e) t.autoLoad && await this.loadPlugin(t);
5343
5398
  }
5344
5399
  async requiredAssetsLoaded() {}
@@ -5367,8 +5422,8 @@ var Ln = {
5367
5422
  _addSplash() {
5368
5423
  this.scenes.splash.view && (this.scenes.splash.view.label = "Splash", this.stage.addChild(this.scenes.splash.view));
5369
5424
  }
5370
- }, zn = {}, Bn = {};
5425
+ }, Bn = {}, Vn = {};
5371
5426
  //#endregion
5372
- export { Le as $, jt as A, _ as At, mt as B, me as Bt, ln as C, xe as Ct, en as D, S as Dt, tn as E, C as Et, xt as F, ve as Ft, st as G, M as H, h as Ht, bt as I, he as It, D as J, A as K, gt as L, de as Lt, _t as M, ye as Mt, vt as N, g as Nt, z as O, y as Ot, yt as P, ge as Pt, qe as Q, ht as R, fe as Rt, fn as S, Ce as St, rn as T, Se as Tt, j as U, se as Ut, pt as V, ue as Vt, lt as W, le as Wt, Je as X, Ye as Y, Xe as Z, gn as _, Oe as _t, Nn as a, Ve as at, Z as b, E as bt, An as c, Be as ct, wn as d, Pe as dt, Re as et, Q as f, Ne as ft, vn as g, ke as gt, bn as h, je as ht, Pn as i, Ge as it, L as j, v as jt, Mt as k, be as kt, On as l, Ie as lt, xn as m, Ae as mt, zn as n, We as nt, jn as o, Ke as ot, Sn as p, Me as pt, k as q, $ as r, He as rt, Mn as s, ze as st, Bn as t, Ue as tt, En as u, Fe as ut, hn as v, De as vt, sn as w, w as wt, X as x, we as xt, mn as y, Ee as yt, P as z, pe as zt };
5427
+ export { Le as $, jt as A, _ as At, mt as B, me as Bt, ln as C, xe as Ct, en as D, S as Dt, tn as E, C as Et, xt as F, ve as Ft, st as G, M as H, h as Ht, bt as I, he as It, D as J, A as K, gt as L, de as Lt, _t as M, ye as Mt, vt as N, g as Nt, z as O, y as Ot, yt as P, ge as Pt, qe as Q, ht as R, fe as Rt, fn as S, Ce as St, rn as T, Se as Tt, j as U, se as Ut, pt as V, ue as Vt, lt as W, le as Wt, Je as X, Ye as Y, Xe as Z, gn as _, Oe as _t, Nn as a, Ve as at, Z as b, E as bt, An as c, Be as ct, wn as d, Pe as dt, Re as et, Q as f, Ne as ft, vn as g, ke as gt, bn as h, je as ht, Pn as i, Ge as it, L as j, v as jt, Mt as k, be as kt, On as l, Ie as lt, xn as m, Ae as mt, Bn as n, We as nt, jn as o, Ke as ot, Sn as p, Me as pt, k as q, $ as r, He as rt, Mn as s, ze as st, Vn as t, Ue as tt, En as u, Fe as ut, hn as v, De as vt, sn as w, w as wt, X as x, we as xt, mn as y, Ee as yt, P as z, pe as zt };
5373
5428
 
5374
- //# sourceMappingURL=registries-BLrxALZ0.js.map
5429
+ //# sourceMappingURL=registries-m2vKTIih.js.map