@caperjs/core 0.4.1 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/build/internal/manifest.mjs +2 -2
  2. package/build/internal/validate.mjs +2 -1
  3. package/build/plugins/assetTypes.mjs +27 -23
  4. package/build/plugins/caperConfig.mjs +5 -3
  5. package/build/plugins/lists.mjs +0 -15
  6. package/lib/{CaptionsPlugin-cSJj-R9M.js → CaptionsPlugin-CDbGZrN9.js} +11 -11
  7. package/lib/CaptionsPlugin-CDbGZrN9.js.map +1 -0
  8. package/lib/{DataAdapter-D2tc6hx9.js → DataAdapter-BTlNzWqg.js} +2 -2
  9. package/lib/{DataAdapter-D2tc6hx9.js.map → DataAdapter-BTlNzWqg.js.map} +1 -1
  10. package/lib/{DebugRenderer-CGUKy6Fy.js → DebugRenderer-eSVpon4c.js} +2 -2
  11. package/lib/{DebugRenderer-CGUKy6Fy.js.map → DebugRenderer-eSVpon4c.js.map} +1 -1
  12. package/lib/{DevToolsPlugin-B8GX3H9b.js → DevToolsPlugin-Ci6r9j-m.js} +2 -2
  13. package/lib/{DevToolsPlugin-B8GX3H9b.js.map → DevToolsPlugin-Ci6r9j-m.js.map} +1 -1
  14. package/lib/{GSAPPlugin-Br9AjuTD.js → GSAPPlugin-C8zo-fyt.js} +2 -2
  15. package/lib/{GSAPPlugin-Br9AjuTD.js.map → GSAPPlugin-C8zo-fyt.js.map} +1 -1
  16. package/lib/{LayoutPlugin-BX3OP7pw.js → LayoutPlugin-Cs2lcXKb.js} +4 -4
  17. package/lib/{LayoutPlugin-BX3OP7pw.js.map → LayoutPlugin-Cs2lcXKb.js.map} +1 -1
  18. package/lib/{SpinePlugin-C-JDdXpf.js → SpinePlugin-CLgSXBQm.js} +2 -2
  19. package/lib/{SpinePlugin-C-JDdXpf.js.map → SpinePlugin-CLgSXBQm.js.map} +1 -1
  20. package/lib/{StatsPlugin-yJlJtoQ2.js → StatsPlugin-D_90U3BG.js} +4 -4
  21. package/lib/{StatsPlugin-yJlJtoQ2.js.map → StatsPlugin-D_90U3BG.js.map} +1 -1
  22. package/lib/{VoiceOverPlugin-DjSZp4Ko.js → VoiceOverPlugin-CAE1dtOw.js} +33 -33
  23. package/lib/{VoiceOverPlugin-DjSZp4Ko.js.map → VoiceOverPlugin-CAE1dtOw.js.map} +1 -1
  24. package/lib/caper.mjs +87 -87
  25. package/lib/caper.mjs.map +1 -1
  26. package/lib/{const-C3sxeYhl.js → const-BTDpIdRO.js} +192 -199
  27. package/lib/const-BTDpIdRO.js.map +1 -0
  28. package/lib/display/Container.d.ts +1 -28
  29. package/lib/display/Container.d.ts.map +1 -1
  30. package/lib/display/ParticleContainer.d.ts +20 -29
  31. package/lib/display/ParticleContainer.d.ts.map +1 -1
  32. package/lib/display/ParticleContainer.test.d.ts +2 -0
  33. package/lib/display/ParticleContainer.test.d.ts.map +1 -0
  34. package/lib/display/SpineAnimation.d.ts +1 -2
  35. package/lib/display/SpineAnimation.d.ts.map +1 -1
  36. package/lib/display/SpineAnimation.test.d.ts +1 -0
  37. package/lib/display/SpineAnimation.test.d.ts.map +1 -0
  38. package/lib/mixins/factory/const.d.ts.map +1 -1
  39. package/lib/mixins/focus.d.ts.map +1 -1
  40. package/lib/mixins/index.d.ts +1 -0
  41. package/lib/mixins/index.d.ts.map +1 -1
  42. package/lib/mixins/lifecycle.d.ts +56 -0
  43. package/lib/mixins/lifecycle.d.ts.map +1 -0
  44. package/lib/plugins/FullScreenPlugin.d.ts.map +1 -1
  45. package/lib/plugins/KeyboardPlugin.d.ts.map +1 -1
  46. package/lib/plugins/Plugin.d.ts.map +1 -1
  47. package/lib/plugins/WebEventsPlugin.d.ts +1 -0
  48. package/lib/plugins/WebEventsPlugin.d.ts.map +1 -1
  49. package/lib/plugins/audio/AudioInstance.d.ts +3 -3
  50. package/lib/plugins/audio/AudioInstance.d.ts.map +1 -1
  51. package/lib/plugins/captions/CaptionsRenderer.d.ts.map +1 -1
  52. package/lib/plugins/focus/FocusManagerPlugin.d.ts.map +1 -1
  53. package/lib/{registries-BfV-VF7a.js → registries-nN_hU44y.js} +109 -77
  54. package/lib/registries-nN_hU44y.js.map +1 -0
  55. package/lib/utils/types.d.ts.map +1 -1
  56. package/package.json +2 -2
  57. package/src/core/Application.ts +2 -2
  58. package/src/display/Container.ts +5 -72
  59. package/src/display/ParticleContainer.test.ts +127 -0
  60. package/src/display/ParticleContainer.ts +28 -62
  61. package/src/display/SpineAnimation.test.ts +79 -0
  62. package/src/display/SpineAnimation.ts +4 -6
  63. package/src/mixins/factory/const.ts +2 -1
  64. package/src/mixins/focus.ts +0 -2
  65. package/src/mixins/index.ts +4 -0
  66. package/src/mixins/lifecycle.ts +160 -0
  67. package/src/plugins/DataAdapter.ts +1 -1
  68. package/src/plugins/FullScreenPlugin.test.ts +9 -0
  69. package/src/plugins/FullScreenPlugin.ts +0 -1
  70. package/src/plugins/KeyboardPlugin.ts +0 -1
  71. package/src/plugins/Plugin.ts +0 -2
  72. package/src/plugins/TimerPlugin.ts +1 -1
  73. package/src/plugins/WebEventsPlugin.test.ts +13 -0
  74. package/src/plugins/WebEventsPlugin.ts +12 -1
  75. package/src/plugins/audio/AudioInstance.ts +2 -2
  76. package/src/plugins/captions/CaptionsPlugin.test.ts +48 -3
  77. package/src/plugins/captions/CaptionsPlugin.ts +5 -5
  78. package/src/plugins/captions/CaptionsRenderer.ts +0 -1
  79. package/src/plugins/focus/FocusManagerPlugin.ts +0 -1
  80. package/src/ui/Input.ts +2 -2
  81. package/src/utils/types.ts +0 -1
  82. package/src/version.ts +1 -1
  83. package/lib/CaptionsPlugin-cSJj-R9M.js.map +0 -1
  84. package/lib/const-C3sxeYhl.js.map +0 -1
  85. package/lib/registries-BfV-VF7a.js.map +0 -1
@@ -827,13 +827,13 @@ var N = class {
827
827
  registerCoreFunctions() {
828
828
  this.getCoreFunctions().forEach((e) => {
829
829
  let t = e;
830
- Jn[t] = this[e];
830
+ Xn[t] = this[e];
831
831
  });
832
832
  }
833
833
  registerCoreSignals() {
834
834
  this.getCoreSignals().forEach((e) => {
835
835
  let t = e;
836
- qn[t] = this[e];
836
+ Yn[t] = this[e];
837
837
  });
838
838
  }
839
839
  getCoreFunctions() {
@@ -1051,7 +1051,7 @@ var ft = class extends N {
1051
1051
  return $.getInstance();
1052
1052
  }
1053
1053
  initialize() {
1054
- this.listen(document, "fullscreenchange", this._onFullScreenChange), this.listen(document, "webkitfullscreenchange", this._onFullScreenChange), this.listen(document, "mozfullscreenchange", this._onFullScreenChange), this.listen(document, "msfullscreenchange", this._onFullScreenChange), this.listen(document, "fullscreenchange", this._onFullScreenChange);
1054
+ this.listen(document, "fullscreenchange", this._onFullScreenChange), this.listen(document, "webkitfullscreenchange", this._onFullScreenChange), this.listen(document, "mozfullscreenchange", this._onFullScreenChange), this.listen(document, "msfullscreenchange", this._onFullScreenChange);
1055
1055
  }
1056
1056
  toggleFullScreen() {
1057
1057
  this.setFullScreen(!this._isFullScreen);
@@ -4127,19 +4127,56 @@ function On(e) {
4127
4127
  };
4128
4128
  }
4129
4129
  //#endregion
4130
+ //#region src/mixins/lifecycle.ts
4131
+ var kn = {
4132
+ autoResize: !0,
4133
+ autoUpdate: !1,
4134
+ resizePriority: 0,
4135
+ updatePriority: -999999
4136
+ };
4137
+ function An(e) {
4138
+ return class extends e {
4139
+ constructor(...e) {
4140
+ super(...e), this.onDestroy = new j(), this.__lifecycleConfig = { ...kn };
4141
+ }
4142
+ static {
4143
+ this.__caper_method_binding_root = !0;
4144
+ }
4145
+ get app() {
4146
+ return $.getInstance();
4147
+ }
4148
+ _initLifecycle(e = {}) {
4149
+ this.__lifecycleConfig = {
4150
+ ...kn,
4151
+ ...e
4152
+ }, this.on("added", this._added), this.on("removed", this._removed);
4153
+ }
4154
+ added() {}
4155
+ removed() {}
4156
+ resize(e) {}
4157
+ update(e) {}
4158
+ destroy(e) {
4159
+ this.__lifecycleConfig.autoUpdate && this.app.ticker.remove(this.update, this), this.onDestroy.emit(), super.destroy(e);
4160
+ }
4161
+ _added() {
4162
+ this.__lifecycleConfig.autoResize && this.addSignalConnection(this.app.onResize.connect(this.resize, this.__lifecycleConfig.resizePriority)), this.__lifecycleConfig.autoUpdate && this.app.ticker.add(this.update, this, this.__lifecycleConfig.updatePriority), this.added();
4163
+ }
4164
+ _removed() {
4165
+ this.__lifecycleConfig.autoResize && this.app.onResize.disconnect(this.resize), this.__lifecycleConfig.autoUpdate && this.app.ticker.remove(this.update, this), this.removed();
4166
+ }
4167
+ };
4168
+ }
4169
+ //#endregion
4130
4170
  //#region src/display/Container.ts
4131
- var kn = [
4171
+ var jn = [
4132
4172
  "autoResize",
4133
4173
  "autoUpdate",
4134
4174
  "priority"
4135
- ], An = {
4175
+ ], Mn = {
4136
4176
  autoResize: !0,
4137
4177
  autoUpdate: !1,
4138
4178
  priority: 0
4139
- }, Q = class e extends Dn(fn(On())) {
4140
- static {
4141
- this.__caper_method_binding_root = !0;
4142
- }
4179
+ }, Q = class e extends An(Dn(fn(On()))) {
4143
4180
  get animationContext() {
4144
4181
  return this._animationContext;
4145
4182
  }
@@ -4158,14 +4195,17 @@ var kn = [
4158
4195
  static childRemoved(t) {
4159
4196
  e.onGlobalChildRemoved.emit(t);
4160
4197
  }
4161
- get app() {
4162
- return $.getInstance();
4163
- }
4164
4198
  constructor(e = {}) {
4165
- super(), this.onDestroy = new j(), this.__config = {
4166
- ...An,
4199
+ super();
4200
+ let { autoResize: t, autoUpdate: n, priority: r } = {
4201
+ ...Mn,
4167
4202
  ...e
4168
- }, _(this), this.on("added", this._added), this.on("removed", this._removed), this.on("childAdded", this._childAdded), this.on("childRemoved", this._childRemoved);
4203
+ };
4204
+ _(this), this._initLifecycle({
4205
+ autoResize: t,
4206
+ autoUpdate: n,
4207
+ resizePriority: r
4208
+ }), this.on("childAdded", this._childAdded), this.on("childRemoved", this._childRemoved);
4169
4209
  }
4170
4210
  addColoredBackground(e = 0, t = 1) {
4171
4211
  let n = {
@@ -4189,24 +4229,14 @@ var kn = [
4189
4229
  resolution: 2
4190
4230
  }), this.setChildIndex(this.__background, 0), r.autoResize && (this.addSignalConnection(this.app.onResize.connect(this.__resizeBackground)), this.__resizeBackground()), this.__background;
4191
4231
  }
4192
- update(e) {}
4193
- resize(e) {}
4194
- added() {}
4195
4232
  childAdded(e) {}
4196
4233
  destroy(e) {
4197
- this.app.animation.killAll(this.animationContext), this.__config.autoUpdate && this.app.ticker.remove(this.update, this), this.onDestroy.emit(), super.destroy(e);
4234
+ this.app.animation.killAll(this.animationContext), super.destroy(e);
4198
4235
  }
4199
- removed() {}
4200
4236
  childRemoved(e) {}
4201
4237
  __resizeBackground() {
4202
4238
  this.__background.width = this.app.size.width, this.__background.height = this.app.size.height;
4203
4239
  }
4204
- _added() {
4205
- this.__config.autoResize && this.addSignalConnection(this.app.onResize.connect(this.resize, this.__config.priority ?? "highest")), this.__config.autoUpdate && this.app.ticker.add(this.update, this, -999999), this.added();
4206
- }
4207
- _removed() {
4208
- this.__config.autoResize && this.app.onResize.disconnect(this.resize), this.__config.autoUpdate && this.app.ticker.remove(this.update, this), this.removed();
4209
- }
4210
4240
  _childAdded(t) {
4211
4241
  e.childAdded(t), this.childAdded(t);
4212
4242
  }
@@ -4216,7 +4246,7 @@ var kn = [
4216
4246
  addAnimation(e, t) {
4217
4247
  return this.app.addAnimation(e, t ?? this.animationContext);
4218
4248
  }
4219
- }, jn = class extends N {
4249
+ }, Nn = class extends N {
4220
4250
  constructor(...e) {
4221
4251
  super(...e), this.id = "popups", this.view = new Q(), this.onShowPopup = new j(), this.onHidePopup = new j(), this.onPopupChanged = new j(), this._popups = /* @__PURE__ */ new Map(), this._activePopups = /* @__PURE__ */ new Map(), this._currentPopupId = void 0;
4222
4252
  }
@@ -4312,7 +4342,7 @@ var kn = [
4312
4342
  _handleEscape() {
4313
4343
  this.current && this.current.config.closeOnEscape && this.hidePopup(this.current.id);
4314
4344
  }
4315
- }, Mn = {
4345
+ }, Pn = {
4316
4346
  autoScroll: !1,
4317
4347
  minWidth: 0,
4318
4348
  minHeight: 0,
@@ -4320,7 +4350,7 @@ var kn = [
4320
4350
  center: !1,
4321
4351
  debug: !1,
4322
4352
  useSafeArea: !0
4323
- }, Nn = class extends N {
4353
+ }, Fn = class extends N {
4324
4354
  constructor(...e) {
4325
4355
  super(...e), this.id = "resizer", this._safeArea = {
4326
4356
  top: 0,
@@ -4342,7 +4372,7 @@ var kn = [
4342
4372
  }
4343
4373
  async initialize(e) {
4344
4374
  this._options = {
4345
- ...Mn,
4375
+ ...Pn,
4346
4376
  ...e
4347
4377
  };
4348
4378
  }
@@ -4424,7 +4454,7 @@ var kn = [
4424
4454
  color: 4095
4425
4455
  });
4426
4456
  }
4427
- }, Pn = {
4457
+ }, In = {
4428
4458
  view: null,
4429
4459
  hideWhen: "firstSceneEnter",
4430
4460
  zOrder: "top",
@@ -4432,7 +4462,7 @@ var kn = [
4432
4462
  assets: [],
4433
4463
  bundles: []
4434
4464
  }
4435
- }, Fn = class extends N {
4465
+ }, Ln = class extends N {
4436
4466
  constructor() {
4437
4467
  super(), this.id = "scenes", this.onSceneChangeStart = new j(), this.onSceneChangeComplete = new j(), this.view = new n(), this.isFirstScene = !0, this.list = [], this.groupOrder = [], this.debugGroupsList = [], this._sceneModules = /* @__PURE__ */ new Map(), this._pendingLoadProps = void 0, this._lastScene = null, this._defaultLoadMethod = "immediate", this._debugVisible = !1, this._useHash = !1, _(this);
4438
4468
  }
@@ -4450,7 +4480,7 @@ var kn = [
4450
4480
  zOrder: "top"
4451
4481
  };
4452
4482
  let e = {
4453
- ...Pn,
4483
+ ...In,
4454
4484
  ...t.config?.splash ?? {}
4455
4485
  };
4456
4486
  e.view && (this.splash.view = typeof e.view == "function" ? new e.view() : e.view), this.splash.preload = e.preload;
@@ -4622,7 +4652,7 @@ var kn = [
4622
4652
  };
4623
4653
  //#endregion
4624
4654
  //#region src/plugins/TimerPlugin.ts
4625
- function In() {
4655
+ function Rn() {
4626
4656
  try {
4627
4657
  let e = new Blob(["\n const timers = new Map();\n\n self.onmessage = (e) => {\n const { type, timerId, options, timeAdjustment } = e.data;\n \n switch (type) {\n case 'start': {\n let timer = timers.get(timerId);\n \n if (timer) {\n // Resume existing timer\n timer.startTime = performance.now() - (timer.pausedTime || 0);\n timer.interval = createInterval(timer, options, timerId);\n } else {\n // Create new timer\n timer = {\n startTime: performance.now(),\n duration: options.duration,\n loopCount: 0,\n pausedTime: 0,\n options // Store options with the timer\n };\n timer.interval = createInterval(timer, options, timerId);\n timers.set(timerId, timer);\n }\n break;\n }\n \n case 'stop': {\n const timer = timers.get(timerId);\n if (timer) {\n clearInterval(timer.interval);\n timer.interval = null;\n timer.pausedTime = performance.now() - timer.startTime;\n }\n break;\n }\n\n case 'reset': {\n const timer = timers.get(timerId);\n if (timer) {\n timer.startTime = performance.now();\n timer.loopCount = 0;\n timer.pausedTime = 0;\n }\n break;\n }\n\n case 'adjustTime': {\n const timer = timers.get(timerId);\n if (timer) {\n if (timer.duration !== undefined) {\n // For countdown timers, adjust the duration\n timer.duration = Math.max(0, timer.duration + timeAdjustment);\n } else {\n // For count-up timers, adjust the start time\n timer.startTime -= timeAdjustment;\n }\n }\n break;\n }\n }\n };\n\n function createInterval(timer, options, timerId) {\n return setInterval(() => {\n const currentTime = performance.now();\n const totalElapsed = currentTime - timer.startTime;\n \n if (timer.duration !== undefined) {\n // Calculate elapsed time within the current loop\n const loopElapsed = totalElapsed - (timer.loopCount * timer.duration);\n const remaining = Math.max(0, timer.duration - loopElapsed);\n \n self.postMessage({ type: 'tick', timerId, time: remaining });\n \n if (remaining <= 0) {\n self.postMessage({ type: 'complete', timerId, time: 0 });\n \n if (options.loop) {\n timer.loopCount++;\n } else {\n clearInterval(timer.interval);\n timers.delete(timerId);\n }\n }\n } else {\n self.postMessage({ type: 'tick', timerId, time: totalElapsed });\n }\n }, options.workerInterval || 16);\n }\n "], { type: "application/javascript" });
4628
4658
  return new Worker(URL.createObjectURL(e));
@@ -4630,7 +4660,7 @@ function In() {
4630
4660
  return null;
4631
4661
  }
4632
4662
  }
4633
- function Ln(e, t = "mm:ss", n = "string") {
4663
+ function zn(e, t = "mm:ss", n = "string") {
4634
4664
  let r = Math.floor(e / 1e3), i = Math.floor(r / 3600), a = Math.floor(r % 3600 / 60), o = r % 60, s = Math.floor(e % 1e3 / 10);
4635
4665
  if (n === "string") switch (t) {
4636
4666
  case "hh:mm:ss": return `${i.toString().padStart(2, "0")}:${a.toString().padStart(2, "0")}:${o.toString().padStart(2, "0")}`;
@@ -4645,7 +4675,7 @@ function Ln(e, t = "mm:ss", n = "string") {
4645
4675
  ms: s
4646
4676
  };
4647
4677
  }
4648
- var Rn = class {
4678
+ var Bn = class {
4649
4679
  constructor(e = {}, t) {
4650
4680
  this.options = e, this.plugin = t, this.startTime = performance.now(), this.pausedTime = 0, this.isPaused = !0, this.isDestroyed = !1, this.timerId = ue(), e.useWorker && !t.hasWorkerSupport && (x.warn("Web Worker support not available, falling back to main thread timer"), e.useWorker = !1), this.isWorkerTimer = !!e.useWorker, e.autoStart && this.start();
4651
4681
  }
@@ -4693,7 +4723,7 @@ var Rn = class {
4693
4723
  removeTime(e) {
4694
4724
  return this.addTime(-e);
4695
4725
  }
4696
- }, zn = class extends N {
4726
+ }, Vn = class extends N {
4697
4727
  get hasWorkerSupport() {
4698
4728
  return this._hasWorkerSupport;
4699
4729
  }
@@ -4735,7 +4765,7 @@ var Rn = class {
4735
4765
  this.addTickerCallback(this.update), this.initWorker();
4736
4766
  }
4737
4767
  initWorker() {
4738
- typeof Worker < "u" ? (this.worker = In(), this.worker ? (this._hasWorkerSupport = !0, this.worker.onmessage = this.handleWorkerMessage) : (x.warn("Failed to create Web Worker for TimerPlugin, all timers will run on main thread"), this._hasWorkerSupport = !1)) : (x.warn("Web Workers not supported in this environment, all timers will run on main thread"), this._hasWorkerSupport = !1);
4768
+ typeof Worker < "u" ? (this.worker = Rn(), this.worker ? (this._hasWorkerSupport = !0, this.worker.onmessage = this.handleWorkerMessage) : (x.warn("Failed to create Web Worker for TimerPlugin, all timers will run on main thread"), this._hasWorkerSupport = !1)) : (x.warn("Web Workers not supported in this environment, all timers will run on main thread"), this._hasWorkerSupport = !1);
4739
4769
  }
4740
4770
  startWorkerTimer(e, t) {
4741
4771
  this.worker && (this.timerCallbacks.set(e, t), this.worker.postMessage({
@@ -4767,7 +4797,7 @@ var Rn = class {
4767
4797
  for (let e of this.mainThreadTimers) e.update();
4768
4798
  }
4769
4799
  createTimer(e) {
4770
- let t = new Rn(e, this);
4800
+ let t = new Bn(e, this);
4771
4801
  return t.isWorker() ? this.workerTimers.add(t) : this.mainThreadTimers.add(t), this.onTimerCreated.emit(t), t;
4772
4802
  }
4773
4803
  destroyTimer(e) {
@@ -4792,17 +4822,19 @@ var Rn = class {
4792
4822
  timeAdjustment: t
4793
4823
  });
4794
4824
  }
4795
- }, Bn = class extends N {
4825
+ }, Hn = class extends N {
4796
4826
  constructor() {
4797
4827
  super(), this.id = "webEvents", this.onResize = new j(), this.onVisibilityChanged = new j(), this.onOrientationChanged = new j(), this._debouncedEmitVisibility = Pe((e) => {
4798
4828
  this.onVisibilityChanged.emit(e);
4799
- }, 1), _(this);
4829
+ }, 1), this._orientationTimeoutId = null, _(this);
4800
4830
  }
4801
4831
  get app() {
4802
4832
  return $.getInstance();
4803
4833
  }
4804
4834
  initialize() {
4805
- this.listen(document, "visibilitychange", this._onVisibilityChanged, !1), this.listen(window, "pagehide", this._onPageHide, !1), this.listen(window, "pageshow", this._onPageShow, !1), this.listen(window, "resize", this._onResize), this.listen(document, "fullscreenchange", this._onResize), this.listen(window, "orientationchange", this._onOrientationChanged), window.visualViewport && this.listen(window.visualViewport, "resize", this._onVisualViewportResize);
4835
+ this.listen(document, "visibilitychange", this._onVisibilityChanged, !1), this.listen(window, "pagehide", this._onPageHide, !1), this.listen(window, "pageshow", this._onPageShow, !1), this.listen(window, "resize", this._onResize), this.listen(document, "fullscreenchange", this._onResize), this.listen(window, "orientationchange", this._onOrientationChanged), window.visualViewport && this.listen(window.visualViewport, "resize", this._onVisualViewportResize), this.addDisposer(() => {
4836
+ this._orientationTimeoutId !== null && (clearTimeout(this._orientationTimeoutId), this._orientationTimeoutId = null);
4837
+ });
4806
4838
  }
4807
4839
  getCoreSignals() {
4808
4840
  return ["onVisibilityChanged", "onOrientationChanged"];
@@ -4838,14 +4870,14 @@ var Rn = class {
4838
4870
  });
4839
4871
  return;
4840
4872
  }
4841
- setTimeout(() => {
4842
- t = qe(), this.onOrientationChanged.emit({
4873
+ this._orientationTimeoutId !== null && clearTimeout(this._orientationTimeoutId), this._orientationTimeoutId = setTimeout(() => {
4874
+ this._orientationTimeoutId = null, t = qe(), this.onOrientationChanged.emit({
4843
4875
  orientation: t,
4844
4876
  screenOrientation: n
4845
4877
  });
4846
4878
  }, 10);
4847
4879
  }
4848
- }, Vn = class extends N {
4880
+ }, Un = class extends N {
4849
4881
  constructor(...e) {
4850
4882
  super(...e), this.name = "lookup", this.pathToContainer = /* @__PURE__ */ new Map(), this.containerToPath = /* @__PURE__ */ new Map();
4851
4883
  }
@@ -4902,15 +4934,15 @@ var Rn = class {
4902
4934
  for (; n && n.label && (t.unshift(n.label), n = n.parent, n?.label !== "Stage"););
4903
4935
  return t.length > 0 ? t.join("/") : "";
4904
4936
  }
4905
- }, Hn = [
4937
+ }, Wn = [
4906
4938
  {
4907
4939
  id: "lookup",
4908
- module: Vn,
4940
+ module: Un,
4909
4941
  namedExport: "LookupPlugin"
4910
4942
  },
4911
4943
  {
4912
4944
  id: "webEvents",
4913
- module: Bn,
4945
+ module: Hn,
4914
4946
  namedExport: "WebEventsPlugin"
4915
4947
  },
4916
4948
  {
@@ -4920,7 +4952,7 @@ var Rn = class {
4920
4952
  },
4921
4953
  {
4922
4954
  id: "resizer",
4923
- module: Nn,
4955
+ module: Fn,
4924
4956
  namedExport: "ResizerPlugin"
4925
4957
  },
4926
4958
  {
@@ -4935,7 +4967,7 @@ var Rn = class {
4935
4967
  },
4936
4968
  {
4937
4969
  id: "scenes",
4938
- module: Fn,
4970
+ module: Ln,
4939
4971
  namedExport: "SceneManagerPlugin"
4940
4972
  },
4941
4973
  {
@@ -4965,7 +4997,7 @@ var Rn = class {
4965
4997
  },
4966
4998
  {
4967
4999
  id: "popups",
4968
- module: jn,
5000
+ module: Nn,
4969
5001
  namedExport: "PopupManagerPlugin"
4970
5002
  },
4971
5003
  {
@@ -4980,16 +5012,16 @@ var Rn = class {
4980
5012
  },
4981
5013
  {
4982
5014
  id: "timers",
4983
- module: zn,
5015
+ module: Vn,
4984
5016
  namedExport: "TimerPlugin"
4985
5017
  }
4986
5018
  ];
4987
5019
  //#endregion
4988
5020
  //#region src/core/Application.ts
4989
- function Un() {
5021
+ function Gn() {
4990
5022
  return typeof window < "u" ? window.devicePixelRatio > 1 ? 2 : 1 : 2;
4991
5023
  }
4992
- var Wn = {
5024
+ var Kn = {
4993
5025
  antialias: !1,
4994
5026
  autoStart: !0,
4995
5027
  resizeToContainer: !0,
@@ -5027,7 +5059,7 @@ var Wn = {
5027
5059
  wordWrap: !1,
5028
5060
  wordWrapWidth: 100
5029
5061
  },
5030
- resolution: Un(),
5062
+ resolution: Gn(),
5031
5063
  useHash: v,
5032
5064
  showSceneDebugMenu: v,
5033
5065
  showStats: v,
@@ -5039,12 +5071,12 @@ var Wn = {
5039
5071
  scenes: [],
5040
5072
  defaultSceneLoadMethod: "immediate",
5041
5073
  assets: { manifest: "./assets.json" }
5042
- }, Gn = {
5074
+ }, qn = {
5043
5075
  pauseAudio: !0,
5044
5076
  pauseAnimations: !0,
5045
5077
  pauseTicker: !0,
5046
5078
  pauseTimers: !0
5047
- }, Kn = {
5079
+ }, Jn = {
5048
5080
  pauseAudio: !1,
5049
5081
  pauseAnimations: !1,
5050
5082
  pauseTicker: !1,
@@ -5070,7 +5102,7 @@ var Wn = {
5070
5102
  }
5071
5103
  pause(e) {
5072
5104
  this._paused = !0, this._pauseConfig = {
5073
- ...e ? Kn : Gn,
5105
+ ...e ? Jn : qn,
5074
5106
  ...e
5075
5107
  }, 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) => {
5076
5108
  typeof e?.pause == "function" && e.pause();
@@ -5237,13 +5269,13 @@ var Wn = {
5237
5269
  return "ontouchstart" in window || navigator.maxTouchPoints > 0;
5238
5270
  }
5239
5271
  get signal() {
5240
- return qn;
5272
+ return Yn;
5241
5273
  }
5242
5274
  get signals() {
5243
5275
  return this.signal;
5244
5276
  }
5245
5277
  get func() {
5246
- return Jn;
5278
+ return Xn;
5247
5279
  }
5248
5280
  get exec() {
5249
5281
  return this.func;
@@ -5265,12 +5297,12 @@ var Wn = {
5265
5297
  }
5266
5298
  async initialize(e, t) {
5267
5299
  if (r.instance) throw Error("Application is already initialized");
5268
- if (r.instance = this, this.config = E(Wn, e), this.signals.onResize = this.onResize, e.container && (r.containerElement = e.container), x.initialize(this.config.logger), this.config.resolution !== 1 && this.config.resolution !== 2) {
5300
+ if (r.instance = this, this.config = E(Kn, e), this.signals.onResize = this.onResize, e.container && (r.containerElement = e.container), x.initialize(this.config.logger), this.config.resolution !== 1 && this.config.resolution !== 2) {
5269
5301
  let e = this.config.resolution;
5270
- this.config.resolution = Un(), x.warn(`App resolution must be 1 or 2, setting to ${this.config.resolution} instead of ${e}. Modify your app config to set the resolution to 1 or 2.`);
5302
+ this.config.resolution = Gn(), x.warn(`App resolution must be 1 or 2, setting to ${this.config.resolution} instead of ${e}. Modify your app config to set the resolution to 1 or 2.`);
5271
5303
  }
5272
5304
  if (await this.boot(this.config), await this.initAssets(), await this.init(this.config), this.stage.label = "Stage", this.config.defaultTextStyle && (l.defaultTextStyle = {
5273
- ...Wn.defaultTextStyle,
5305
+ ...Kn.defaultTextStyle,
5274
5306
  ...this.config.defaultTextStyle
5275
5307
  }), this.config.defaultDropShadow && (l.defaultDropShadow = this.config.defaultDropShadow), t) t.appendChild(this.canvas), this.setContainer(t);
5276
5308
  else throw Error("No element found to append the view to.");
@@ -5337,7 +5369,7 @@ var Wn = {
5337
5369
  }
5338
5370
  async boot(e) {
5339
5371
  this.config = {
5340
- ...Wn,
5372
+ ...Kn,
5341
5373
  ...e
5342
5374
  }, await this.preInitialize(this.config);
5343
5375
  }
@@ -5345,23 +5377,23 @@ var Wn = {
5345
5377
  let { id: t } = e;
5346
5378
  this._appName = t, v && await this.loadPlugin({
5347
5379
  id: "DevToolsPlugin",
5348
- module: () => import("./DevToolsPlugin-B8GX3H9b.js"),
5380
+ module: () => import("./DevToolsPlugin-Ci6r9j-m.js"),
5349
5381
  namedExport: "DevToolsPlugin"
5350
5382
  }), e.useLayout && await this.loadPlugin({
5351
5383
  id: "LayoutPlugin",
5352
- module: () => import("./LayoutPlugin-BX3OP7pw.js"),
5384
+ module: () => import("./LayoutPlugin-Cs2lcXKb.js"),
5353
5385
  namedExport: "LayoutPlugin"
5354
5386
  }), await this.loadPlugin({
5355
5387
  id: "GSAPPlugin",
5356
- module: () => import("./GSAPPlugin-Br9AjuTD.js"),
5388
+ module: () => import("./GSAPPlugin-C8zo-fyt.js"),
5357
5389
  namedExport: "GSAPPlugin"
5358
5390
  }), e.useSpine && await this.loadPlugin({
5359
5391
  id: "SpinePlugin",
5360
- module: () => import("./SpinePlugin-C-JDdXpf.js"),
5392
+ module: () => import("./SpinePlugin-CLgSXBQm.js"),
5361
5393
  namedExport: "SpinePlugin"
5362
5394
  }), this.config.useStore && (this._store = new lt(), this._store.initialize(this), await this.loadPlugin({
5363
5395
  id: "data",
5364
- module: () => import("./DataAdapter-D2tc6hx9.js").then((e) => e.n),
5396
+ module: () => import("./DataAdapter-BTlNzWqg.js").then((e) => e.n),
5365
5397
  namedExport: "DataAdapter",
5366
5398
  options: this.config.data
5367
5399
  }));
@@ -5384,22 +5416,22 @@ var Wn = {
5384
5416
  }
5385
5417
  }
5386
5418
  async registerDefaultPlugins() {
5387
- for (let e = 0; e < Hn.length; e++) {
5388
- let t = Hn[e];
5419
+ for (let e = 0; e < Wn.length; e++) {
5420
+ let t = Wn[e];
5389
5421
  await this.loadPlugin(t, !0);
5390
5422
  }
5391
5423
  (this.config.showStats === !0 || v && this.config.showStats !== !1) && await this.loadPlugin({
5392
5424
  id: "stats",
5393
- module: () => import("./StatsPlugin-yJlJtoQ2.js"),
5425
+ module: () => import("./StatsPlugin-D_90U3BG.js"),
5394
5426
  namedExport: "StatsPlugin"
5395
5427
  }), this.config.useVoiceover && (await this.loadPlugin({
5396
5428
  id: "voiceover",
5397
- module: () => import("./VoiceOverPlugin-DjSZp4Ko.js"),
5429
+ module: () => import("./VoiceOverPlugin-CAE1dtOw.js"),
5398
5430
  namedExport: "VoiceOverPlugin",
5399
5431
  options: this.config.voiceover || void 0
5400
5432
  }), await this.loadPlugin({
5401
5433
  id: "captions",
5402
- module: () => import("./CaptionsPlugin-cSJj-R9M.js"),
5434
+ module: () => import("./CaptionsPlugin-CDbGZrN9.js"),
5403
5435
  namedExport: "CaptionsPlugin",
5404
5436
  options: this.config.captions || void 0
5405
5437
  }));
@@ -5435,8 +5467,8 @@ var Wn = {
5435
5467
  _addSplash() {
5436
5468
  this.scenes.splash.view && (this.scenes.splash.view.label = "Splash", this.stage.addChild(this.scenes.splash.view));
5437
5469
  }
5438
- }, qn = {}, Jn = {};
5470
+ }, Yn = {}, Xn = {};
5439
5471
  //#endregion
5440
- export { Le as $, At as A, ve as At, pt as B, pe as Bt, cn as C, Se as Ct, $t as D, x as Dt, en as E, S as Et, bt as F, _e as Ft, j as G, N as H, h as Ht, yt as I, me as It, Qe as J, A as K, ht as L, g as Lt, gt as M, ye as Mt, _t as N, _ as Nt, Mt as O, y as Ot, vt as P, he as Pt, qe as Q, mt as R, de as Rt, dn as S, we as St, nn as T, Ce as Tt, M as U, se as Ut, ft as V, ue as Vt, lt as W, le as Wt, Je as X, Ye as Y, Xe as Z, Cn as _, ke as _t, Bn as a, Ve as at, fn as b, T as bt, Ln as c, Be as ct, jn as d, Fe as dt, Re as et, Q as f, Pe as ft, Tn as g, Ae as gt, Dn as h, Me as ht, Vn as i, Ge as it, R as j, v as jt, jt as k, be as kt, Fn as l, E as lt, On as m, je as mt, qn as n, We as nt, Rn as o, Ke as ot, kn as p, Ne as pt, O as q, $ as r, He as rt, zn as s, ze as st, Jn as t, Ue as tt, Nn as u, Ie as ut, Sn as v, Oe as vt, on as w, C as wt, Z as x, Te as xt, xn as y, De as yt, F as z, fe as zt };
5472
+ export { qe as $, jt as A, be as At, F as B, fe as Bt, dn as C, we as Ct, en as D, S as Dt, nn as E, Ce as Et, vt as F, he as Ft, lt as G, le as Gt, ft as H, ue as Ht, bt as I, _e as It, O as J, j as K, yt as L, me as Lt, R as M, v as Mt, gt as N, ye as Nt, $t as O, x as Ot, _t as P, _ as Pt, Xe as Q, ht as R, g as Rt, Z as S, Te as St, on as T, C as Tt, N as U, h as Ut, pt as V, pe as Vt, M as W, se as Wt, Ye as X, Qe as Y, Je as Z, Tn as _, Ae as _t, Hn as a, Ge as at, xn as b, De as bt, zn as c, ze as ct, Nn as d, Ie as dt, Le as et, Q as f, Fe as ft, Dn as g, Me as gt, On as h, je as ht, Un as i, He as it, At as j, ve as jt, Mt as k, y as kt, Ln as l, Be as lt, An as m, Ne as mt, Yn as n, Ue as nt, Bn as o, Ve as ot, jn as p, Pe as pt, A as q, $ as r, We as rt, Vn as s, Ke as st, Xn as t, Re as tt, Fn as u, E as ut, Cn as v, ke as vt, cn as w, Se as wt, fn as x, T as xt, Sn as y, Oe as yt, mt as z, de as zt };
5441
5473
 
5442
- //# sourceMappingURL=registries-BfV-VF7a.js.map
5474
+ //# sourceMappingURL=registries-nN_hU44y.js.map