@caperjs/core 0.1.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/LICENSE +22 -0
- package/README.md +62 -0
- package/cli/add.mjs +197 -0
- package/cli/audio/cc.mjs +128 -0
- package/cli/audio/index.mjs +42 -0
- package/cli/audio/utils.mjs +56 -0
- package/cli/create-caper.mjs +8 -0
- package/cli/create.mjs +351 -0
- package/cli/install-peerdeps.mjs +57 -0
- package/cli/update.mjs +9 -0
- package/cli/utils.mjs +81 -0
- package/cli/vite.mjs +55 -0
- package/cli/voiceover/generateVoiceoverCSV.mjs +158 -0
- package/cli/voiceover/index.mjs +1 -0
- package/cli.mjs +157 -0
- package/client.d.ts +7 -0
- package/config/assetpack.mjs +212 -0
- package/config/tsconfig.base.json +28 -0
- package/config/vite.mjs +2464 -0
- package/extras/css/accessibility.css +9 -0
- package/extras/css/fullscreen.css +28 -0
- package/extras/css/loader.css +67 -0
- package/extras/llms.txt +1602 -0
- package/lib/CaptionsPlugin-Dc8fIrjy.js +277 -0
- package/lib/CaptionsPlugin-Dc8fIrjy.js.map +1 -0
- package/lib/DataAdapter-BY2114sp.js +84 -0
- package/lib/DataAdapter-BY2114sp.js.map +1 -0
- package/lib/DebugRenderer-BJMLILqI.js +1385 -0
- package/lib/DebugRenderer-BJMLILqI.js.map +1 -0
- package/lib/DevToolsPlugin-wQ5rOkn0.js +31 -0
- package/lib/DevToolsPlugin-wQ5rOkn0.js.map +1 -0
- package/lib/GSAPPlugin-DHhSZKv8.js +350 -0
- package/lib/GSAPPlugin-DHhSZKv8.js.map +1 -0
- package/lib/LayoutPlugin-B-DF9SYM.js +1271 -0
- package/lib/LayoutPlugin-B-DF9SYM.js.map +1 -0
- package/lib/SpinePlugin-Dz_3dljz.js +6077 -0
- package/lib/SpinePlugin-Dz_3dljz.js.map +1 -0
- package/lib/StatsPlugin-Cg82JMBD.js +70 -0
- package/lib/StatsPlugin-Cg82JMBD.js.map +1 -0
- package/lib/VoiceOverPlugin-BR3ImT8C.js +114 -0
- package/lib/VoiceOverPlugin-BR3ImT8C.js.map +1 -0
- package/lib/caper.mjs +1233 -0
- package/lib/caper.mjs.map +1 -0
- package/lib/core/Application.d.ts +268 -0
- package/lib/core/Application.d.ts.map +1 -0
- package/lib/core/config.d.ts +39 -0
- package/lib/core/config.d.ts.map +1 -0
- package/lib/core/create.d.ts +41 -0
- package/lib/core/create.d.ts.map +1 -0
- package/lib/core/globals.d.ts +51 -0
- package/lib/core/globals.d.ts.map +1 -0
- package/lib/core/index.d.ts +7 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/interfaces/IApplication.d.ts +566 -0
- package/lib/core/interfaces/IApplication.d.ts.map +1 -0
- package/lib/core/interfaces/IApplicationOptions.d.ts +65 -0
- package/lib/core/interfaces/IApplicationOptions.d.ts.map +1 -0
- package/lib/core/interfaces/ICoreFunctions.d.ts +49 -0
- package/lib/core/interfaces/ICoreFunctions.d.ts.map +1 -0
- package/lib/core/interfaces/ICoreSignals.d.ts +57 -0
- package/lib/core/interfaces/ICoreSignals.d.ts.map +1 -0
- package/lib/core/interfaces/IStorageCapability.d.ts +20 -0
- package/lib/core/interfaces/IStorageCapability.d.ts.map +1 -0
- package/lib/core/interfaces/IStorageCapability.test.d.ts +2 -0
- package/lib/core/interfaces/IStorageCapability.test.d.ts.map +1 -0
- package/lib/core/interfaces/index.d.ts +7 -0
- package/lib/core/interfaces/index.d.ts.map +1 -0
- package/lib/core/registries.d.ts +8 -0
- package/lib/core/registries.d.ts.map +1 -0
- package/lib/core/types.d.ts +12 -0
- package/lib/core/types.d.ts.map +1 -0
- package/lib/display/AnimatedSprite.d.ts +40 -0
- package/lib/display/AnimatedSprite.d.ts.map +1 -0
- package/lib/display/Camera.d.ts +102 -0
- package/lib/display/Camera.d.ts.map +1 -0
- package/lib/display/Container.d.ts +115 -0
- package/lib/display/Container.d.ts.map +1 -0
- package/lib/display/Entity.d.ts +46 -0
- package/lib/display/Entity.d.ts.map +1 -0
- package/lib/display/ParticleContainer.d.ts +58 -0
- package/lib/display/ParticleContainer.d.ts.map +1 -0
- package/lib/display/Scene.d.ts +250 -0
- package/lib/display/Scene.d.ts.map +1 -0
- package/lib/display/SceneTransition.d.ts +41 -0
- package/lib/display/SceneTransition.d.ts.map +1 -0
- package/lib/display/SpineAnimation.d.ts +76 -0
- package/lib/display/SpineAnimation.d.ts.map +1 -0
- package/lib/display/Svg.d.ts +5 -0
- package/lib/display/Svg.d.ts.map +1 -0
- package/lib/display/index.d.ts +10 -0
- package/lib/display/index.d.ts.map +1 -0
- package/lib/env.d.ts +6 -0
- package/lib/hello.d.ts +2 -0
- package/lib/hello.d.ts.map +1 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/mixins/animated.d.ts +53 -0
- package/lib/mixins/animated.d.ts.map +1 -0
- package/lib/mixins/factory/Factory.d.ts +8 -0
- package/lib/mixins/factory/Factory.d.ts.map +1 -0
- package/lib/mixins/factory/const.d.ts +67 -0
- package/lib/mixins/factory/const.d.ts.map +1 -0
- package/lib/mixins/factory/index.d.ts +8 -0
- package/lib/mixins/factory/index.d.ts.map +1 -0
- package/lib/mixins/factory/methods.d.ts +3 -0
- package/lib/mixins/factory/methods.d.ts.map +1 -0
- package/lib/mixins/factory/props.d.ts +160 -0
- package/lib/mixins/factory/props.d.ts.map +1 -0
- package/lib/mixins/factory/registry.d.ts +27 -0
- package/lib/mixins/factory/registry.d.ts.map +1 -0
- package/lib/mixins/factory/registry.test.d.ts +2 -0
- package/lib/mixins/factory/registry.test.d.ts.map +1 -0
- package/lib/mixins/factory/schema.d.ts +71 -0
- package/lib/mixins/factory/schema.d.ts.map +1 -0
- package/lib/mixins/factory/ui-registry.d.ts +20 -0
- package/lib/mixins/factory/ui-registry.d.ts.map +1 -0
- package/lib/mixins/factory/utils.d.ts +11 -0
- package/lib/mixins/factory/utils.d.ts.map +1 -0
- package/lib/mixins/focus.d.ts +15 -0
- package/lib/mixins/focus.d.ts.map +1 -0
- package/lib/mixins/index.d.ts +6 -0
- package/lib/mixins/index.d.ts.map +1 -0
- package/lib/mixins/interaction.d.ts +20 -0
- package/lib/mixins/interaction.d.ts.map +1 -0
- package/lib/mixins/signals.d.ts +15 -0
- package/lib/mixins/signals.d.ts.map +1 -0
- package/lib/plugins/AssetsPlugin.d.ts +79 -0
- package/lib/plugins/AssetsPlugin.d.ts.map +1 -0
- package/lib/plugins/DataAdapter.d.ts +95 -0
- package/lib/plugins/DataAdapter.d.ts.map +1 -0
- package/lib/plugins/DevToolsPlugin.d.ts +97 -0
- package/lib/plugins/DevToolsPlugin.d.ts.map +1 -0
- package/lib/plugins/FullScreenPlugin.d.ts +240 -0
- package/lib/plugins/FullScreenPlugin.d.ts.map +1 -0
- package/lib/plugins/GSAPPlugin.d.ts +634 -0
- package/lib/plugins/GSAPPlugin.d.ts.map +1 -0
- package/lib/plugins/KeyboardPlugin.d.ts +53 -0
- package/lib/plugins/KeyboardPlugin.d.ts.map +1 -0
- package/lib/plugins/LayoutPlugin.d.ts +100 -0
- package/lib/plugins/LayoutPlugin.d.ts.map +1 -0
- package/lib/plugins/LookupPlugin.d.ts +223 -0
- package/lib/plugins/LookupPlugin.d.ts.map +1 -0
- package/lib/plugins/Plugin.d.ts +132 -0
- package/lib/plugins/Plugin.d.ts.map +1 -0
- package/lib/plugins/Plugin.test.d.ts +2 -0
- package/lib/plugins/Plugin.test.d.ts.map +1 -0
- package/lib/plugins/PopupManagerPlugin.d.ts +108 -0
- package/lib/plugins/PopupManagerPlugin.d.ts.map +1 -0
- package/lib/plugins/ResizerPlugin.d.ts +62 -0
- package/lib/plugins/ResizerPlugin.d.ts.map +1 -0
- package/lib/plugins/SceneManagerPlugin.d.ts +122 -0
- package/lib/plugins/SceneManagerPlugin.d.ts.map +1 -0
- package/lib/plugins/StatsPlugin.d.ts +8 -0
- package/lib/plugins/StatsPlugin.d.ts.map +1 -0
- package/lib/plugins/TimerPlugin.d.ts +401 -0
- package/lib/plugins/TimerPlugin.d.ts.map +1 -0
- package/lib/plugins/WebEventsPlugin.d.ts +60 -0
- package/lib/plugins/WebEventsPlugin.d.ts.map +1 -0
- package/lib/plugins/actions/ActionsPlugin.d.ts +39 -0
- package/lib/plugins/actions/ActionsPlugin.d.ts.map +1 -0
- package/lib/plugins/actions/constants.d.ts +52 -0
- package/lib/plugins/actions/constants.d.ts.map +1 -0
- package/lib/plugins/actions/index.d.ts +5 -0
- package/lib/plugins/actions/index.d.ts.map +1 -0
- package/lib/plugins/actions/methods.d.ts +11 -0
- package/lib/plugins/actions/methods.d.ts.map +1 -0
- package/lib/plugins/actions/types.d.ts +25 -0
- package/lib/plugins/actions/types.d.ts.map +1 -0
- package/lib/plugins/audio/AudioChannel.d.ts +46 -0
- package/lib/plugins/audio/AudioChannel.d.ts.map +1 -0
- package/lib/plugins/audio/AudioChannel.test.d.ts +2 -0
- package/lib/plugins/audio/AudioChannel.test.d.ts.map +1 -0
- package/lib/plugins/audio/AudioInstance.d.ts +79 -0
- package/lib/plugins/audio/AudioInstance.d.ts.map +1 -0
- package/lib/plugins/audio/AudioManagerPlugin.d.ts +323 -0
- package/lib/plugins/audio/AudioManagerPlugin.d.ts.map +1 -0
- package/lib/plugins/audio/VoiceOverPlugin.d.ts +69 -0
- package/lib/plugins/audio/VoiceOverPlugin.d.ts.map +1 -0
- package/lib/plugins/audio/index.d.ts +4 -0
- package/lib/plugins/audio/index.d.ts.map +1 -0
- package/lib/plugins/breakpoints/BreakpointPlugin.d.ts +109 -0
- package/lib/plugins/breakpoints/BreakpointPlugin.d.ts.map +1 -0
- package/lib/plugins/breakpoints/BreakpointPlugin.test.d.ts +2 -0
- package/lib/plugins/breakpoints/BreakpointPlugin.test.d.ts.map +1 -0
- package/lib/plugins/breakpoints/evaluate.d.ts +53 -0
- package/lib/plugins/breakpoints/evaluate.d.ts.map +1 -0
- package/lib/plugins/breakpoints/evaluate.test.d.ts +2 -0
- package/lib/plugins/breakpoints/evaluate.test.d.ts.map +1 -0
- package/lib/plugins/breakpoints/index.d.ts +4 -0
- package/lib/plugins/breakpoints/index.d.ts.map +1 -0
- package/lib/plugins/breakpoints/methods.d.ts +23 -0
- package/lib/plugins/breakpoints/methods.d.ts.map +1 -0
- package/lib/plugins/breakpoints/types.d.ts +70 -0
- package/lib/plugins/breakpoints/types.d.ts.map +1 -0
- package/lib/plugins/captions/CaptionsPlugin.d.ts +150 -0
- package/lib/plugins/captions/CaptionsPlugin.d.ts.map +1 -0
- package/lib/plugins/captions/CaptionsRenderer.d.ts +37 -0
- package/lib/plugins/captions/CaptionsRenderer.d.ts.map +1 -0
- package/lib/plugins/captions/index.d.ts +3 -0
- package/lib/plugins/captions/index.d.ts.map +1 -0
- package/lib/plugins/defaults.d.ts +4 -0
- package/lib/plugins/defaults.d.ts.map +1 -0
- package/lib/plugins/focus/FocusManagerPlugin.d.ts +148 -0
- package/lib/plugins/focus/FocusManagerPlugin.d.ts.map +1 -0
- package/lib/plugins/focus/FocusOutliner.d.ts +32 -0
- package/lib/plugins/focus/FocusOutliner.d.ts.map +1 -0
- package/lib/plugins/focus/index.d.ts +3 -0
- package/lib/plugins/focus/index.d.ts.map +1 -0
- package/lib/plugins/i18nPlugin.d.ts +128 -0
- package/lib/plugins/i18nPlugin.d.ts.map +1 -0
- package/lib/plugins/index.d.ts +18 -0
- package/lib/plugins/index.d.ts.map +1 -0
- package/lib/plugins/input/AbstractControls.d.ts +8 -0
- package/lib/plugins/input/AbstractControls.d.ts.map +1 -0
- package/lib/plugins/input/Controls.d.ts +16 -0
- package/lib/plugins/input/Controls.d.ts.map +1 -0
- package/lib/plugins/input/InputPlugin.d.ts +52 -0
- package/lib/plugins/input/InputPlugin.d.ts.map +1 -0
- package/lib/plugins/input/constants.d.ts +8 -0
- package/lib/plugins/input/constants.d.ts.map +1 -0
- package/lib/plugins/input/index.d.ts +10 -0
- package/lib/plugins/input/index.d.ts.map +1 -0
- package/lib/plugins/input/interfaces.d.ts +30 -0
- package/lib/plugins/input/interfaces.d.ts.map +1 -0
- package/lib/plugins/input/keyboard/KeyboardContols.d.ts +28 -0
- package/lib/plugins/input/keyboard/KeyboardContols.d.ts.map +1 -0
- package/lib/plugins/input/keyboard/index.d.ts +3 -0
- package/lib/plugins/input/keyboard/index.d.ts.map +1 -0
- package/lib/plugins/input/keyboard/interfaces.d.ts +18 -0
- package/lib/plugins/input/keyboard/interfaces.d.ts.map +1 -0
- package/lib/plugins/input/methods.d.ts +4 -0
- package/lib/plugins/input/methods.d.ts.map +1 -0
- package/lib/plugins/input/touch/TouchControls.d.ts +35 -0
- package/lib/plugins/input/touch/TouchControls.d.ts.map +1 -0
- package/lib/plugins/input/touch/constants.d.ts +14 -0
- package/lib/plugins/input/touch/constants.d.ts.map +1 -0
- package/lib/plugins/input/touch/index.d.ts +4 -0
- package/lib/plugins/input/touch/index.d.ts.map +1 -0
- package/lib/plugins/input/touch/interfaces.d.ts +15 -0
- package/lib/plugins/input/touch/interfaces.d.ts.map +1 -0
- package/lib/plugins/input/types.d.ts +32 -0
- package/lib/plugins/input/types.d.ts.map +1 -0
- package/lib/plugins/input/utils.d.ts +23 -0
- package/lib/plugins/input/utils.d.ts.map +1 -0
- package/lib/plugins/spine/SpinePlugin.d.ts +6 -0
- package/lib/plugins/spine/SpinePlugin.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/BatchableSpineSlot.d.ts +31 -0
- package/lib/plugins/spine/pixi-spine/BatchableSpineSlot.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/Spine.d.ts +211 -0
- package/lib/plugins/spine/pixi-spine/Spine.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/SpineDebugRenderer.d.ts +81 -0
- package/lib/plugins/spine/pixi-spine/SpineDebugRenderer.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/SpinePipe.d.ts +21 -0
- package/lib/plugins/spine/pixi-spine/SpinePipe.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/SpineTexture.d.ts +16 -0
- package/lib/plugins/spine/pixi-spine/SpineTexture.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/assets/atlasLoader.d.ts +10 -0
- package/lib/plugins/spine/pixi-spine/assets/atlasLoader.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/assets/skeletonLoader.d.ts +6 -0
- package/lib/plugins/spine/pixi-spine/assets/skeletonLoader.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintBatchGeometry.d.ts +5 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintBatchGeometry.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintBatcher.d.ts +22 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintBatcher.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintShader.d.ts +5 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintShader.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/darktint/darkTintBit.d.ts +51 -0
- package/lib/plugins/spine/pixi-spine/darktint/darkTintBit.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/index.d.ts +9 -0
- package/lib/plugins/spine/pixi-spine/index.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/require-shim.d.ts +34 -0
- package/lib/plugins/spine/pixi-spine/require-shim.d.ts.map +1 -0
- package/lib/registries-CYCaYKZI.js +6885 -0
- package/lib/registries-CYCaYKZI.js.map +1 -0
- package/lib/signals/Signal.d.ts +16 -0
- package/lib/signals/Signal.d.ts.map +1 -0
- package/lib/signals/Signal.test.d.ts +2 -0
- package/lib/signals/Signal.test.d.ts.map +1 -0
- package/lib/signals/index.d.ts +3 -0
- package/lib/signals/index.d.ts.map +1 -0
- package/lib/store/Store.d.ts +56 -0
- package/lib/store/Store.d.ts.map +1 -0
- package/lib/store/Store.test.d.ts +2 -0
- package/lib/store/Store.test.d.ts.map +1 -0
- package/lib/store/index.d.ts +2 -0
- package/lib/store/index.d.ts.map +1 -0
- package/lib/types/framework.d.ts +46 -0
- package/lib/types/gsap.d.ts +23 -0
- package/lib/ui/Button.d.ts +162 -0
- package/lib/ui/Button.d.ts.map +1 -0
- package/lib/ui/FlexContainer.d.ts +109 -0
- package/lib/ui/FlexContainer.d.ts.map +1 -0
- package/lib/ui/Input.d.ts +384 -0
- package/lib/ui/Input.d.ts.map +1 -0
- package/lib/ui/Joystick.d.ts +61 -0
- package/lib/ui/Joystick.d.ts.map +1 -0
- package/lib/ui/Popup.d.ts +109 -0
- package/lib/ui/Popup.d.ts.map +1 -0
- package/lib/ui/Toast.d.ts +131 -0
- package/lib/ui/Toast.d.ts.map +1 -0
- package/lib/ui/Toaster.d.ts +188 -0
- package/lib/ui/Toaster.d.ts.map +1 -0
- package/lib/ui/UICanvas.d.ts +155 -0
- package/lib/ui/UICanvas.d.ts.map +1 -0
- package/lib/ui/index.d.ts +9 -0
- package/lib/ui/index.d.ts.map +1 -0
- package/lib/utils/array.d.ts +11 -0
- package/lib/utils/array.d.ts.map +1 -0
- package/lib/utils/bind.d.ts +21 -0
- package/lib/utils/bind.d.ts.map +1 -0
- package/lib/utils/canvas.d.ts +2 -0
- package/lib/utils/canvas.d.ts.map +1 -0
- package/lib/utils/color.d.ts +66 -0
- package/lib/utils/color.d.ts.map +1 -0
- package/lib/utils/console/Logger.d.ts +15 -0
- package/lib/utils/console/Logger.d.ts.map +1 -0
- package/lib/utils/console/index.d.ts +2 -0
- package/lib/utils/console/index.d.ts.map +1 -0
- package/lib/utils/debug.d.ts +34 -0
- package/lib/utils/debug.d.ts.map +1 -0
- package/lib/utils/define.d.ts +100 -0
- package/lib/utils/define.d.ts.map +1 -0
- package/lib/utils/env.d.ts +4 -0
- package/lib/utils/env.d.ts.map +1 -0
- package/lib/utils/events.d.ts +12 -0
- package/lib/utils/events.d.ts.map +1 -0
- package/lib/utils/framework.d.ts +12 -0
- package/lib/utils/framework.d.ts.map +1 -0
- package/lib/utils/index.d.ts +28 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/map.d.ts +31 -0
- package/lib/utils/map.d.ts.map +1 -0
- package/lib/utils/math.d.ts +15 -0
- package/lib/utils/math.d.ts.map +1 -0
- package/lib/utils/misc.d.ts +13 -0
- package/lib/utils/misc.d.ts.map +1 -0
- package/lib/utils/number.d.ts +2 -0
- package/lib/utils/number.d.ts.map +1 -0
- package/lib/utils/object.d.ts +21 -0
- package/lib/utils/object.d.ts.map +1 -0
- package/lib/utils/padding.d.ts +4 -0
- package/lib/utils/padding.d.ts.map +1 -0
- package/lib/utils/pixi.d.ts +42 -0
- package/lib/utils/pixi.d.ts.map +1 -0
- package/lib/utils/platform.d.ts +20 -0
- package/lib/utils/platform.d.ts.map +1 -0
- package/lib/utils/point.d.ts +66 -0
- package/lib/utils/point.d.ts.map +1 -0
- package/lib/utils/promise/Queue.d.ts +60 -0
- package/lib/utils/promise/Queue.d.ts.map +1 -0
- package/lib/utils/promise/functions.d.ts +14 -0
- package/lib/utils/promise/functions.d.ts.map +1 -0
- package/lib/utils/promise/index.d.ts +3 -0
- package/lib/utils/promise/index.d.ts.map +1 -0
- package/lib/utils/random.d.ts +42 -0
- package/lib/utils/random.d.ts.map +1 -0
- package/lib/utils/rect.d.ts +26 -0
- package/lib/utils/rect.d.ts.map +1 -0
- package/lib/utils/set.d.ts +15 -0
- package/lib/utils/set.d.ts.map +1 -0
- package/lib/utils/string.d.ts +3 -0
- package/lib/utils/string.d.ts.map +1 -0
- package/lib/utils/text.d.ts +3 -0
- package/lib/utils/text.d.ts.map +1 -0
- package/lib/utils/typefilters.d.ts +4 -0
- package/lib/utils/typefilters.d.ts.map +1 -0
- package/lib/utils/types.d.ts +209 -0
- package/lib/utils/types.d.ts.map +1 -0
- package/lib/utils/vite.d.ts +25 -0
- package/lib/utils/vite.d.ts.map +1 -0
- package/lib/utils/web.d.ts +3 -0
- package/lib/utils/web.d.ts.map +1 -0
- package/lib/version.d.ts +3 -0
- package/lib/version.d.ts.map +1 -0
- package/lib/webgl-check.d.ts +2 -0
- package/lib/webgl-check.d.ts.map +1 -0
- package/package.json +138 -0
- package/src/core/Application.ts +1091 -0
- package/src/core/config.ts +168 -0
- package/src/core/create.ts +186 -0
- package/src/core/globals.ts +299 -0
- package/src/core/index.ts +6 -0
- package/src/core/interfaces/IApplication.ts +628 -0
- package/src/core/interfaces/IApplicationOptions.ts +81 -0
- package/src/core/interfaces/ICoreFunctions.ts +86 -0
- package/src/core/interfaces/ICoreSignals.ts +77 -0
- package/src/core/interfaces/IStorageCapability.test.ts +27 -0
- package/src/core/interfaces/IStorageCapability.ts +26 -0
- package/src/core/interfaces/index.ts +6 -0
- package/src/core/registries.ts +7 -0
- package/src/core/types.ts +13 -0
- package/src/display/AnimatedSprite.ts +227 -0
- package/src/display/Camera.ts +371 -0
- package/src/display/Container.ts +240 -0
- package/src/display/Entity.ts +50 -0
- package/src/display/ParticleContainer.ts +107 -0
- package/src/display/Scene.ts +305 -0
- package/src/display/SceneTransition.ts +108 -0
- package/src/display/SpineAnimation.ts +170 -0
- package/src/display/Svg.ts +9 -0
- package/src/display/index.ts +11 -0
- package/src/env.d.ts +6 -0
- package/src/hello.ts +20 -0
- package/src/index.ts +17 -0
- package/src/mixins/animated.ts +340 -0
- package/src/mixins/factory/Factory.ts +24 -0
- package/src/mixins/factory/const.ts +363 -0
- package/src/mixins/factory/index.ts +7 -0
- package/src/mixins/factory/methods.ts +21 -0
- package/src/mixins/factory/props.ts +207 -0
- package/src/mixins/factory/registry.test.ts +83 -0
- package/src/mixins/factory/registry.ts +61 -0
- package/src/mixins/factory/schema.ts +153 -0
- package/src/mixins/factory/ui-registry.ts +54 -0
- package/src/mixins/factory/utils.ts +130 -0
- package/src/mixins/focus.ts +124 -0
- package/src/mixins/index.ts +5 -0
- package/src/mixins/interaction.ts +74 -0
- package/src/mixins/signals.ts +49 -0
- package/src/plugins/AssetsPlugin.ts +407 -0
- package/src/plugins/DataAdapter.ts +259 -0
- package/src/plugins/DevToolsPlugin.ts +103 -0
- package/src/plugins/FullScreenPlugin.ts +359 -0
- package/src/plugins/GSAPPlugin.ts +811 -0
- package/src/plugins/KeyboardPlugin.ts +160 -0
- package/src/plugins/LayoutPlugin.ts +127 -0
- package/src/plugins/LookupPlugin.ts +308 -0
- package/src/plugins/Plugin.test.ts +73 -0
- package/src/plugins/Plugin.ts +200 -0
- package/src/plugins/PopupManagerPlugin.ts +263 -0
- package/src/plugins/ResizerPlugin.ts +220 -0
- package/src/plugins/SceneManagerPlugin.ts +669 -0
- package/src/plugins/StatsPlugin.ts +24 -0
- package/src/plugins/TimerPlugin.ts +841 -0
- package/src/plugins/WebEventsPlugin.ts +132 -0
- package/src/plugins/actions/ActionsPlugin.ts +113 -0
- package/src/plugins/actions/constants.ts +45 -0
- package/src/plugins/actions/index.ts +4 -0
- package/src/plugins/actions/methods.ts +28 -0
- package/src/plugins/actions/types.ts +47 -0
- package/src/plugins/audio/AudioChannel.test.ts +101 -0
- package/src/plugins/audio/AudioChannel.ts +164 -0
- package/src/plugins/audio/AudioInstance.ts +228 -0
- package/src/plugins/audio/AudioManagerPlugin.ts +903 -0
- package/src/plugins/audio/VoiceOverPlugin.ts +354 -0
- package/src/plugins/audio/index.ts +3 -0
- package/src/plugins/breakpoints/BreakpointPlugin.test.ts +228 -0
- package/src/plugins/breakpoints/BreakpointPlugin.ts +293 -0
- package/src/plugins/breakpoints/evaluate.test.ts +239 -0
- package/src/plugins/breakpoints/evaluate.ts +201 -0
- package/src/plugins/breakpoints/index.ts +3 -0
- package/src/plugins/breakpoints/methods.ts +22 -0
- package/src/plugins/breakpoints/types.ts +86 -0
- package/src/plugins/captions/CaptionsPlugin.ts +468 -0
- package/src/plugins/captions/CaptionsRenderer.ts +184 -0
- package/src/plugins/captions/font/Sans.fnt +116 -0
- package/src/plugins/captions/font/Sans.png +0 -0
- package/src/plugins/captions/index.ts +2 -0
- package/src/plugins/defaults.ts +95 -0
- package/src/plugins/focus/FocusManagerPlugin.ts +773 -0
- package/src/plugins/focus/FocusOutliner.ts +111 -0
- package/src/plugins/focus/index.ts +2 -0
- package/src/plugins/i18nPlugin.ts +284 -0
- package/src/plugins/index.ts +17 -0
- package/src/plugins/input/AbstractControls.ts +15 -0
- package/src/plugins/input/Controls.ts +55 -0
- package/src/plugins/input/InputPlugin.ts +168 -0
- package/src/plugins/input/constants.ts +12 -0
- package/src/plugins/input/index.ts +9 -0
- package/src/plugins/input/interfaces.ts +37 -0
- package/src/plugins/input/keyboard/KeyboardContols.ts +182 -0
- package/src/plugins/input/keyboard/index.ts +2 -0
- package/src/plugins/input/keyboard/interfaces.ts +21 -0
- package/src/plugins/input/methods.ts +9 -0
- package/src/plugins/input/touch/TouchControls.ts +237 -0
- package/src/plugins/input/touch/constants.ts +34 -0
- package/src/plugins/input/touch/index.ts +3 -0
- package/src/plugins/input/touch/interfaces.ts +15 -0
- package/src/plugins/input/types.ts +41 -0
- package/src/plugins/input/utils.ts +10 -0
- package/src/plugins/spine/SpinePlugin.ts +14 -0
- package/src/plugins/spine/pixi-spine/BatchableSpineSlot.ts +138 -0
- package/src/plugins/spine/pixi-spine/Spine.ts +897 -0
- package/src/plugins/spine/pixi-spine/SpineDebugRenderer.ts +615 -0
- package/src/plugins/spine/pixi-spine/SpinePipe.ts +197 -0
- package/src/plugins/spine/pixi-spine/SpineTexture.ts +143 -0
- package/src/plugins/spine/pixi-spine/assets/atlasLoader.ts +156 -0
- package/src/plugins/spine/pixi-spine/assets/skeletonLoader.ts +80 -0
- package/src/plugins/spine/pixi-spine/darktint/DarkTintBatchGeometry.ts +92 -0
- package/src/plugins/spine/pixi-spine/darktint/DarkTintBatcher.ts +186 -0
- package/src/plugins/spine/pixi-spine/darktint/DarkTintShader.ts +74 -0
- package/src/plugins/spine/pixi-spine/darktint/darkTintBit.ts +77 -0
- package/src/plugins/spine/pixi-spine/index.ts +43 -0
- package/src/plugins/spine/pixi-spine/require-shim.ts +43 -0
- package/src/signals/Signal.test.ts +54 -0
- package/src/signals/Signal.ts +68 -0
- package/src/signals/index.ts +10 -0
- package/src/store/Store.test.ts +146 -0
- package/src/store/Store.ts +192 -0
- package/src/store/index.ts +1 -0
- package/src/types/framework.d.ts +47 -0
- package/src/types/gsap.d.ts +26 -0
- package/src/ui/Button.ts +454 -0
- package/src/ui/FlexContainer.ts +526 -0
- package/src/ui/Input.ts +1274 -0
- package/src/ui/Joystick.ts +288 -0
- package/src/ui/Popup.ts +242 -0
- package/src/ui/Toast.ts +399 -0
- package/src/ui/Toaster.ts +409 -0
- package/src/ui/UICanvas.ts +812 -0
- package/src/ui/index.ts +8 -0
- package/src/utils/array.ts +24 -0
- package/src/utils/bind.ts +79 -0
- package/src/utils/canvas.ts +26 -0
- package/src/utils/color.ts +126 -0
- package/src/utils/console/Logger.ts +86 -0
- package/src/utils/console/index.ts +1 -0
- package/src/utils/debug.ts +69 -0
- package/src/utils/define.ts +120 -0
- package/src/utils/env.ts +3 -0
- package/src/utils/events.ts +10 -0
- package/src/utils/framework.ts +45 -0
- package/src/utils/index.ts +27 -0
- package/src/utils/map.ts +59 -0
- package/src/utils/math.ts +19 -0
- package/src/utils/misc.ts +45 -0
- package/src/utils/number.ts +3 -0
- package/src/utils/object.ts +43 -0
- package/src/utils/padding.ts +43 -0
- package/src/utils/pixi.ts +116 -0
- package/src/utils/platform.ts +33 -0
- package/src/utils/point.ts +123 -0
- package/src/utils/promise/Queue.ts +125 -0
- package/src/utils/promise/functions.ts +16 -0
- package/src/utils/promise/index.ts +2 -0
- package/src/utils/random.ts +69 -0
- package/src/utils/rect.ts +50 -0
- package/src/utils/set.ts +32 -0
- package/src/utils/string.ts +9 -0
- package/src/utils/text.ts +30 -0
- package/src/utils/typefilters.ts +29 -0
- package/src/utils/types.ts +426 -0
- package/src/utils/vite.ts +41 -0
- package/src/utils/web.ts +7 -0
- package/src/version.ts +3 -0
- package/src/webgl-check.ts +12 -0
- package/templates/app/default/.eslintrc.json +21 -0
- package/templates/app/default/.meta.json +4 -0
- package/templates/app/default/.nvmrc +1 -0
- package/templates/app/default/.prettierrc.json +7 -0
- package/templates/app/default/README.md +8 -0
- package/templates/app/default/assets/audio{m}/music/Cheerful Annoyance.ogg +0 -0
- package/templates/app/default/assets/audio{m}/music/Drumming Sticks.ogg +0 -0
- package/templates/app/default/assets/audio{m}/music/Game Over.ogg +0 -0
- package/templates/app/default/assets/audio{m}/music/Mishief Stroll.ogg +0 -0
- package/templates/app/default/assets/audio{m}/music/Night at the Beach.ogg +0 -0
- package/templates/app/default/assets/audio{m}/sfx/click.ogg +0 -0
- package/templates/app/default/assets/audio{m}/sfx/hover.ogg +0 -0
- package/templates/app/default/assets/required{m}/caper.png +0 -0
- package/templates/app/default/assets/required{m}/fonts{fix}/SpaceGrotesk-Bold{family=Space Grotesk}{wf}.ttf +0 -0
- package/templates/app/default/assets/required{m}/fonts{fix}/SpaceGrotesk-Medium{family=Space Grotesk}{wf}.ttf +0 -0
- package/templates/app/default/assets/required{m}/fonts{fix}/SpaceGrotesk-Regular{family=Space Grotesk}{wf}.ttf +0 -0
- package/templates/app/default/assets/required{m}/fonts{fix}/Syncopate-Bold{family=Syncopate}{wf}.ttf +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/blue.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/green.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/grey.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/orange.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/purple.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/red.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/yellow.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_a/down.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_a/over.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_a/up.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_b/down.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_b/over.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_b/up.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/joystick/base.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/joystick/handle.png +0 -0
- package/templates/app/default/assets/required{m}/wordmark.svg +1 -0
- package/templates/app/default/assets/spine{m}/spineboy-pro.png +0 -0
- package/templates/app/default/assets/spine{m}/spineboy-pro.skel +0 -0
- package/templates/app/default/assets/spine{m}/spineboy-pro{fix}.atlas +94 -0
- package/templates/app/default/caper.config.ts +60 -0
- package/templates/app/default/index.html +23 -0
- package/templates/app/default/package.template.json +17 -0
- package/templates/app/default/public/favicon.ico +0 -0
- package/templates/app/default/src/__APPLICATION_NAME__.ts +3 -0
- package/templates/app/default/src/main.ts +9 -0
- package/templates/app/default/src/scenes/Base.ts +39 -0
- package/templates/app/default/src/scenes/Game.ts +34 -0
- package/templates/app/default/src/scenes/Splash.ts +70 -0
- package/templates/app/default/src/scenes/Start.ts +90 -0
- package/templates/app/default/src/utils/Constants.ts +3 -0
- package/templates/app/default/tsconfig.json +1 -0
- package/templates/plugin/package.template.json +33 -0
- package/templates/plugin/src/Plugin.template.ts +24 -0
- package/templates/plugin/src/index.template.ts +3 -0
- package/templates/plugin/tsconfig.template.json +43 -0
- package/templates/plugin/vite-env.template.d.ts +16 -0
- package/templates/plugin/vite.config.template.ts +19 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Sn as e, Z as t, r as n, wn as r } from "./registries-CYCaYKZI.js";
|
|
2
|
+
import { Ticker as i, UPDATE_PRIORITY as a } from "pixi.js";
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region src/plugins/StatsPlugin.ts
|
|
5
|
+
var o = /* @__PURE__ */ r((/* @__PURE__ */ e(((e, t) => {
|
|
6
|
+
(function(n, r) {
|
|
7
|
+
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : n.Stats = r();
|
|
8
|
+
})(e, function() {
|
|
9
|
+
var e = function() {
|
|
10
|
+
function t(e) {
|
|
11
|
+
return i.appendChild(e.dom), e;
|
|
12
|
+
}
|
|
13
|
+
function n(e) {
|
|
14
|
+
for (var t = 0; t < i.children.length; t++) i.children[t].style.display = t === e ? "block" : "none";
|
|
15
|
+
r = e;
|
|
16
|
+
}
|
|
17
|
+
var r = 0, i = document.createElement("div");
|
|
18
|
+
i.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", i.addEventListener("click", function(e) {
|
|
19
|
+
e.preventDefault(), n(++r % i.children.length);
|
|
20
|
+
}, !1);
|
|
21
|
+
var a = (performance || Date).now(), o = a, s = 0, c = t(new e.Panel("FPS", "#0ff", "#002")), l = t(new e.Panel("MS", "#0f0", "#020"));
|
|
22
|
+
if (self.performance && self.performance.memory) var u = t(new e.Panel("MB", "#f08", "#201"));
|
|
23
|
+
return n(0), {
|
|
24
|
+
REVISION: 16,
|
|
25
|
+
dom: i,
|
|
26
|
+
addPanel: t,
|
|
27
|
+
showPanel: n,
|
|
28
|
+
begin: function() {
|
|
29
|
+
a = (performance || Date).now();
|
|
30
|
+
},
|
|
31
|
+
end: function() {
|
|
32
|
+
s++;
|
|
33
|
+
var e = (performance || Date).now();
|
|
34
|
+
if (l.update(e - a, 200), e > o + 1e3 && (c.update(1e3 * s / (e - o), 100), o = e, s = 0, u)) {
|
|
35
|
+
var t = performance.memory;
|
|
36
|
+
u.update(t.usedJSHeapSize / 1048576, t.jsHeapSizeLimit / 1048576);
|
|
37
|
+
}
|
|
38
|
+
return e;
|
|
39
|
+
},
|
|
40
|
+
update: function() {
|
|
41
|
+
a = this.end();
|
|
42
|
+
},
|
|
43
|
+
domElement: i,
|
|
44
|
+
setMode: n
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
return e.Panel = function(e, t, n) {
|
|
48
|
+
var r = Infinity, i = 0, a = Math.round, o = a(window.devicePixelRatio || 1), s = 80 * o, c = 48 * o, l = 3 * o, u = 2 * o, d = 3 * o, f = 15 * o, p = 74 * o, m = 30 * o, h = document.createElement("canvas");
|
|
49
|
+
h.width = s, h.height = c, h.style.cssText = "width:80px;height:48px";
|
|
50
|
+
var g = h.getContext("2d");
|
|
51
|
+
return g.font = "bold " + 9 * o + "px Helvetica,Arial,sans-serif", g.textBaseline = "top", g.fillStyle = n, g.fillRect(0, 0, s, c), g.fillStyle = t, g.fillText(e, l, u), g.fillRect(d, f, p, m), g.fillStyle = n, g.globalAlpha = .9, g.fillRect(d, f, p, m), {
|
|
52
|
+
dom: h,
|
|
53
|
+
update: function(c, _) {
|
|
54
|
+
r = Math.min(r, c), i = Math.max(i, c), g.fillStyle = n, g.globalAlpha = 1, g.fillRect(0, 0, s, f), g.fillStyle = t, g.fillText(a(c) + " " + e + " (" + a(r) + "-" + a(i) + ")", l, u), g.drawImage(h, d + o, f, p - o, m, d, f, p - o, m), g.fillRect(d + p - o, f, o, m), g.fillStyle = n, g.globalAlpha = .9, g.fillRect(d + p - o, f, o, a((1 - c / _) * m));
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}, e;
|
|
58
|
+
});
|
|
59
|
+
})))(), 1), s = class extends t {
|
|
60
|
+
constructor(...e) {
|
|
61
|
+
super(...e), this.id = "StatsPlugin";
|
|
62
|
+
}
|
|
63
|
+
async initialize() {
|
|
64
|
+
this.stats = new o.default(), this.stats.dom.id = "stats", n.containerElement?.appendChild(this.stats.dom), this.stats.dom.style.position = "absolute", this.stats.dom.style.top = "auto", this.stats.dom.style.bottom = "0", this.stats.dom.style.right = "0", this.stats.dom.style.left = "auto", i.shared.add(this.stats.update, this.stats, a.UTILITY);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
//#endregion
|
|
68
|
+
export { s as StatsPlugin };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=StatsPlugin-Cg82JMBD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatsPlugin-Cg82JMBD.js","names":[],"sources":["../../../node_modules/.pnpm/stats.js@0.17.0/node_modules/stats.js/build/stats.min.js","../src/plugins/StatsPlugin.ts"],"sourcesContent":["// stats.js - http://github.com/mrdoob/stats.js\n(function(f,e){\"object\"===typeof exports&&\"undefined\"!==typeof module?module.exports=e():\"function\"===typeof define&&define.amd?define(e):f.Stats=e()})(this,function(){var f=function(){function e(a){c.appendChild(a.dom);return a}function u(a){for(var d=0;d<c.children.length;d++)c.children[d].style.display=d===a?\"block\":\"none\";l=a}var l=0,c=document.createElement(\"div\");c.style.cssText=\"position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000\";c.addEventListener(\"click\",function(a){a.preventDefault();\nu(++l%c.children.length)},!1);var k=(performance||Date).now(),g=k,a=0,r=e(new f.Panel(\"FPS\",\"#0ff\",\"#002\")),h=e(new f.Panel(\"MS\",\"#0f0\",\"#020\"));if(self.performance&&self.performance.memory)var t=e(new f.Panel(\"MB\",\"#f08\",\"#201\"));u(0);return{REVISION:16,dom:c,addPanel:e,showPanel:u,begin:function(){k=(performance||Date).now()},end:function(){a++;var c=(performance||Date).now();h.update(c-k,200);if(c>g+1E3&&(r.update(1E3*a/(c-g),100),g=c,a=0,t)){var d=performance.memory;t.update(d.usedJSHeapSize/\n1048576,d.jsHeapSizeLimit/1048576)}return c},update:function(){k=this.end()},domElement:c,setMode:u}};f.Panel=function(e,f,l){var c=Infinity,k=0,g=Math.round,a=g(window.devicePixelRatio||1),r=80*a,h=48*a,t=3*a,v=2*a,d=3*a,m=15*a,n=74*a,p=30*a,q=document.createElement(\"canvas\");q.width=r;q.height=h;q.style.cssText=\"width:80px;height:48px\";var b=q.getContext(\"2d\");b.font=\"bold \"+9*a+\"px Helvetica,Arial,sans-serif\";b.textBaseline=\"top\";b.fillStyle=l;b.fillRect(0,0,r,h);b.fillStyle=f;b.fillText(e,t,v);\nb.fillRect(d,m,n,p);b.fillStyle=l;b.globalAlpha=.9;b.fillRect(d,m,n,p);return{dom:q,update:function(h,w){c=Math.min(c,h);k=Math.max(k,h);b.fillStyle=l;b.globalAlpha=1;b.fillRect(0,0,r,m);b.fillStyle=f;b.fillText(g(h)+\" \"+e+\" (\"+g(c)+\"-\"+g(k)+\")\",t,v);b.drawImage(q,d+a,m,n-a,p,d,m,n-a,p);b.fillRect(d+n-a,m,a,p);b.fillStyle=l;b.globalAlpha=.9;b.fillRect(d+n-a,m,a,g((1-h/w)*p))}}};return f});\n","import { Ticker, UPDATE_PRIORITY } from 'pixi.js';\nimport Stats from 'stats.js';\nimport { Application } from '../core/Application';\nimport { Plugin } from './Plugin';\n\nexport class StatsPlugin extends Plugin {\n public readonly id = 'StatsPlugin';\n public stats: Stats;\n\n public async initialize() {\n this.stats = new Stats();\n this.stats.dom.id = 'stats';\n\n Application.containerElement?.appendChild(this.stats.dom);\n\n this.stats.dom.style.position = 'absolute';\n this.stats.dom.style.top = 'auto';\n this.stats.dom.style.bottom = '0';\n this.stats.dom.style.right = '0';\n this.stats.dom.style.left = 'auto';\n\n Ticker.shared.add(this.stats.update, this.stats, UPDATE_PRIORITY.UTILITY);\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;AACA,EAAC,SAAS,GAAE,GAAE;AAAC,EAAW,OAAO,KAAlB,YAAgD,MAArB,SAA4B,EAAO,UAAQ,GAAG,GAAc,OAAO,UAApB,cAA4B,OAAO,MAAI,OAAO,EAAE,GAAC,EAAE,QAAM,GAAG;OAAQ,WAAU;EAAC,IAAI,IAAE,WAAU;GAAC,SAAS,EAAE,GAAE;AAAsB,WAArB,EAAE,YAAY,EAAE,IAAI,EAAQ;;GAAE,SAAS,EAAE,GAAE;AAAC,SAAI,IAAI,IAAE,GAAE,IAAE,EAAE,SAAS,QAAO,IAAI,GAAE,SAAS,GAAG,MAAM,UAAQ,MAAI,IAAE,UAAQ;AAAO,QAAE;;GAAE,IAAI,IAAE,GAAE,IAAE,SAAS,cAAc,MAAM;AAAwF,GAAvF,EAAE,MAAM,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,MAAM,WAAW,YAChC,KAAK,MAAM,IAAI,MAAM,MAAM,QAC3B,KAAK,MAAM,IAAI,MAAM,SAAS,KAC9B,KAAK,MAAM,IAAI,MAAM,QAAQ,KAC7B,KAAK,MAAM,IAAI,MAAM,OAAO,QAE5B,EAAO,OAAO,IAAI,KAAK,MAAM,QAAQ,KAAK,OAAO,EAAgB,QAAQ"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Z as e, gt as t, sn as n } from "./registries-CYCaYKZI.js";
|
|
2
|
+
//#region src/plugins/audio/VoiceOverPlugin.ts
|
|
3
|
+
var r = class extends e {
|
|
4
|
+
constructor(...e) {
|
|
5
|
+
super(...e), this.id = "voiceover", this.fadeOutDuration = .15, this.debug = !1, this.onVoiceOverStart = new t(), this.onVoiceOverPaused = new t(), this.onVoiceOverComplete = new t(), this.onVoiceOverResumed = new t(), this.onVoiceOverStopped = new t(), this._queue = [], this._pausedQueue = [], this._paused = !1;
|
|
6
|
+
}
|
|
7
|
+
get paused() {
|
|
8
|
+
return this._paused;
|
|
9
|
+
}
|
|
10
|
+
get activeTimeout() {
|
|
11
|
+
return this._queue[0]?.timeout;
|
|
12
|
+
}
|
|
13
|
+
get activeVO() {
|
|
14
|
+
if (this._queue.length > 0 && this._queue[0].key) return this.app.audio.getAudioInstance(this._queue[0].key, "voiceover");
|
|
15
|
+
}
|
|
16
|
+
async initialize() {
|
|
17
|
+
this.app.actions("pause").connect(this.onPause), this.app.actions("unpause").connect(this.onResume), this.app.scenes.onSceneChangeStart.connect(this.stopVO);
|
|
18
|
+
}
|
|
19
|
+
async playVO(e, t, r) {
|
|
20
|
+
Array.isArray(e) || (e = [e]);
|
|
21
|
+
let i = 0, a = "override", o = "";
|
|
22
|
+
if (typeof t == "function") r = t;
|
|
23
|
+
else if (typeof t == "object") {
|
|
24
|
+
let n = t;
|
|
25
|
+
i = n.priority ?? 0, r = n.callback, a = n.mode ?? "override", n.localized && (o = this.app.i18n.locale, e = e.map((e) => `${e}_${o}`));
|
|
26
|
+
}
|
|
27
|
+
if (typeof t == "string" && (a = t), this._paused = !1, e.length === 1 && this._queue.length === 1 && this._queue[0].key === e[0]) n.warn(`đ Skipped VO ${e[0]} because it is already playing`), r && r(!1);
|
|
28
|
+
else if (this._queue.length === 0 || a === "override" && i >= this._queue[0].priority || a === "new" && i > this._queue[0].priority) return await this.stopVO(), this.addToQueue(e, r, i), this.playNext();
|
|
29
|
+
else a === "append" ? this.addToQueue(e, r, i) : r ? (n.warn(`đđ Firing callback without playing VO(s) ${e.join(", ")}`), r(!1)) : n.warn(`đ Skipped VO(s) ${e.join(", ")} because it is lower priority than what was already playing`);
|
|
30
|
+
}
|
|
31
|
+
async stopVO() {
|
|
32
|
+
let e = this.activeVO, t = this._queue[0];
|
|
33
|
+
this._queue.splice(0, this._queue.length), this._pausedQueue.splice(0, this._pausedQueue.length), t?.timeout?.kill(), e ? e.media ? e.isPlaying ? (n.log(`đ¤Ģ Fading out VO ${e.id} (duration:${this.fadeOutDuration})`), await e.fadeTo(0, this.fadeOutDuration), e.stop()) : e.stop() : (n.warn(`đ Stopping VO %c%s%c while it is still loading ${e.id}`), e.remove()) : (n.warn("đ No active VO to stop"), this.activeTimeout?.kill()), this.clearSignalConnections(), this._paused = !1, this.onVoiceOverStopped.emit(e);
|
|
34
|
+
}
|
|
35
|
+
pauseVO() {
|
|
36
|
+
if (!this._paused && this._queue.length > 0) {
|
|
37
|
+
this._paused = !0, this._pausedQueue.push(...this._queue);
|
|
38
|
+
let e = this.activeVO, t = this.activeTimeout;
|
|
39
|
+
e?.pause(), t?.pause(), this._queue.splice(0, this._queue.length);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
resumeVO() {
|
|
43
|
+
if (this._paused && (this._paused = !1, this._pausedQueue.length > 0)) {
|
|
44
|
+
this._queue.push(...this._pausedQueue), this._pausedQueue.splice(0, this._pausedQueue.length);
|
|
45
|
+
let e = this.activeVO, t = this.activeTimeout;
|
|
46
|
+
e?.resume(), t?.resume(), e && this.onVoiceOverStart.emit(e);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
getCoreSignals() {
|
|
50
|
+
return [
|
|
51
|
+
"onVoiceOverStart",
|
|
52
|
+
"onVoiceOverPaused",
|
|
53
|
+
"onVoiceOverComplete",
|
|
54
|
+
"onVoiceOverResumed",
|
|
55
|
+
"onVoiceOverStopped"
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
addToQueue(e, t, r) {
|
|
59
|
+
for (let i = 0; i < e.length; i++) {
|
|
60
|
+
let a = e[i];
|
|
61
|
+
typeof a == "number" ? n.log(`â Queueing delay ${a}`) : n.log(`â Queueing VO ${a}`), this._queue.push({
|
|
62
|
+
key: typeof a == "string" ? a : "",
|
|
63
|
+
delay: typeof a == "number" ? a : void 0,
|
|
64
|
+
callback: i === e.length - 1 ? t : void 0,
|
|
65
|
+
priority: r
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
let i = e.filter((e) => typeof e == "string");
|
|
69
|
+
n.log(`đ Loading VO(s) ${i.join(", ")}`), this.app.audio.load(i, "voiceover");
|
|
70
|
+
}
|
|
71
|
+
async playNext() {
|
|
72
|
+
if (this._queue.length > 0) {
|
|
73
|
+
let e = this._queue[0];
|
|
74
|
+
if (e.delay !== void 0) {
|
|
75
|
+
if (this.activeTimeout?.kill(), this._queue.length === 1) return n.log("â Skipping delay because there are no more items in queue"), this._queue.shift(), e.callback && e.callback(!0), this.playNext();
|
|
76
|
+
n.log("âŗ Waiting %s seconds before next VO", e.delay), e.timeout = gsap.delayedCall(e.delay, () => (this._queue.shift(), e.callback && e.callback(!0), this.playNext()));
|
|
77
|
+
} else {
|
|
78
|
+
let t = this.app.audio.getAudioInstance(e.key, "voiceover");
|
|
79
|
+
t ? t.isPlaying && (n.warn("đ Stopping VO %c%s%c (no fade out)", t.id), t.stop(), this.onVoiceOverComplete.emit(t)) : n.log("đ Loading VO %c%s%c", e.key);
|
|
80
|
+
let r = await this.app.audio.play(e.key, "voiceover", { singleInstance: !0 });
|
|
81
|
+
return this.activeVO && this.onVoiceOverStart.emit(this.activeVO), this._queue[0] === e ? (n.log(`âļī¸âļī¸ Playing VO ${e.key}`), n.log("âšī¸ Queue length:", this._queue.length), this.activeVO ? this.addSignalConnection(this.activeVO.onEnd.connectOnce(this._handleActiveVOEnded), this.activeVO.onPaused.connectOnce(this._handleActiveVOPaused), this.activeVO.onResumed.connectOnce(this._handleActiveVOResumed), this.activeVO.onStart.connectOnce(this._handleActiveVOStarted)) : (n.error("â ī¸ Vo %c%s%c completed early (did not play?)", e.key), this._handleActiveVOEndedWithoutPlaying(r)), r) : void 0;
|
|
82
|
+
}
|
|
83
|
+
} else n.log("â
Nothing left in queue");
|
|
84
|
+
}
|
|
85
|
+
_handleActiveVOStarted(e) {
|
|
86
|
+
this.onVoiceOverStart.emit(this.activeVO || e);
|
|
87
|
+
}
|
|
88
|
+
_handleActiveVOPaused(e) {
|
|
89
|
+
this.onVoiceOverPaused.emit(this.activeVO || e);
|
|
90
|
+
}
|
|
91
|
+
_handleActiveVOResumed(e) {
|
|
92
|
+
this.onVoiceOverResumed.emit(this.activeVO || e);
|
|
93
|
+
}
|
|
94
|
+
_handleActiveVOEndedWithoutPlaying(e) {
|
|
95
|
+
this.onVoiceOverComplete.emit(this.activeVO || e), this.activeTimeout?.kill(), this._currentItemCallback(!1), this._queue.shift(), this.playNext();
|
|
96
|
+
}
|
|
97
|
+
_handleActiveVOEnded(e) {
|
|
98
|
+
this.onVoiceOverComplete.emit(this.activeVO || e), this.activeTimeout?.kill(), this._currentItemCallback(), this._queue.shift(), this.playNext();
|
|
99
|
+
}
|
|
100
|
+
_currentItemCallback(e = !0) {
|
|
101
|
+
let t = this._queue[0];
|
|
102
|
+
t && (n.log(`đ Completed VO ${t.key}`), t.callback && (n.log("'đ Firing callback for", t.key), t.callback(e)));
|
|
103
|
+
}
|
|
104
|
+
onPause() {
|
|
105
|
+
this.activeVO !== void 0 && this.activeVO.isPlaying && (n.log("⸠Pausing VO", this.activeVO.id), this.activeVO.pause(), this.onVoiceOverComplete.emit(this.activeVO)), this.activeTimeout?.pause();
|
|
106
|
+
}
|
|
107
|
+
onResume() {
|
|
108
|
+
this.activeVO !== void 0 && !this.activeVO.isPlaying && (n.log("⯠Resuming VO", this.activeVO.id), this.activeVO.resume(), this.onVoiceOverStart.emit(this.activeVO)), this.activeTimeout?.resume();
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
//#endregion
|
|
112
|
+
export { r as VoiceOverPlugin };
|
|
113
|
+
|
|
114
|
+
//# sourceMappingURL=VoiceOverPlugin-BR3ImT8C.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceOverPlugin-BR3ImT8C.js","names":[],"sources":["../src/plugins/audio/VoiceOverPlugin.ts"],"sourcesContent":["import { Signal } from '../../signals';\nimport { Logger } from '../../utils';\nimport type { IPlugin } from '../Plugin';\nimport { Plugin } from '../Plugin';\nimport { IAudioInstance } from './AudioInstance';\n\nexport type PlayMode = 'append' | 'override' | 'new';\nexport type VoCallback = (didPlay: boolean) => void;\nexport type VoKey = string | number;\n\nexport type Caption = {\n id: string;\n args?: { [key: string]: string };\n};\n\nexport interface IPlayVoiceOverOptions {\n mode?: PlayMode;\n priority?: number;\n callback?: VoCallback;\n localized?: boolean;\n}\n\ninterface IQueueItem extends IPlayVoiceOverOptions {\n key: string;\n delay?: number;\n timeout?: gsap.core.Tween;\n}\n\nexport interface IVoiceOverPlugin extends IPlugin {\n fadeOutDuration: number;\n debug: boolean;\n onVoiceOverStart: Signal<(instance: IAudioInstance) => void>;\n onVoiceOverPaused: Signal<(instance: IAudioInstance) => void>;\n onVoiceOverResumed: Signal<(instance: IAudioInstance) => void>;\n onVoiceOverComplete: Signal<(instance: IAudioInstance) => void>;\n onVoiceOverStopped: Signal<(instance?: IAudioInstance) => void>;\n paused: boolean;\n\n playVO(key: VoKey | VoKey[], mode?: PlayMode, callback?: VoCallback): Promise<IAudioInstance>;\n\n playVO(key: VoKey | VoKey[], callback?: VoCallback): Promise<IAudioInstance>;\n\n playVO(key: VoKey | VoKey[], options?: IPlayVoiceOverOptions): Promise<IAudioInstance>;\n\n stopVO(): Promise<void>;\n\n pauseVO(): void;\n\n resumeVO(): void;\n}\n\nexport class VoiceOverPlugin extends Plugin implements IVoiceOverPlugin {\n public readonly id = 'voiceover';\n public fadeOutDuration = 0.15;\n public debug = false;\n public onVoiceOverStart: Signal<(instance: IAudioInstance) => void> = new Signal<\n (instance: IAudioInstance) => void\n >();\n public onVoiceOverPaused: Signal<(instance: IAudioInstance) => void> = new Signal<\n (instance: IAudioInstance) => void\n >();\n public onVoiceOverComplete: Signal<(instance: IAudioInstance) => void> = new Signal<\n (instance: IAudioInstance) => void\n >();\n public onVoiceOverResumed: Signal<(instance: IAudioInstance) => void> = new Signal<\n (instance: IAudioInstance) => void\n >();\n public onVoiceOverStopped: Signal<(instance?: IAudioInstance) => void> = new Signal<\n (instance: IAudioInstance) => void\n >();\n private readonly _queue: IQueueItem[] = [];\n private readonly _pausedQueue: IQueueItem[] = [];\n private _paused: boolean = false;\n\n get paused() {\n return this._paused;\n }\n\n get activeTimeout(): gsap.core.Tween | undefined {\n return this._queue[0]?.timeout;\n }\n\n get activeVO(): IAudioInstance | undefined {\n if (this._queue.length > 0 && this._queue[0].key) {\n return this.app.audio.getAudioInstance(this._queue[0].key, 'voiceover') as IAudioInstance | undefined;\n }\n return undefined;\n }\n\n async initialize() {\n this.app.actions('pause').connect(this.onPause);\n this.app.actions('unpause').connect(this.onResume);\n this.app.scenes.onSceneChangeStart.connect(this.stopVO);\n }\n\n playVO(key: VoKey | VoKey[], mode?: PlayMode, callback?: VoCallback): Promise<IAudioInstance>;\n\n playVO(key: VoKey | VoKey[], callback?: VoCallback): Promise<IAudioInstance>;\n\n playVO(key: VoKey | VoKey[], options?: IPlayVoiceOverOptions): Promise<IAudioInstance>;\n\n async playVO(\n key: VoKey | VoKey[],\n modeOrCallbackOrOptions?: PlayMode | VoCallback | IPlayVoiceOverOptions,\n callback?: VoCallback,\n ): Promise<IAudioInstance | void> {\n if (!Array.isArray(key)) {\n key = [key];\n }\n\n let priority = 0;\n let mode: string | undefined = 'override';\n let locale: string = '';\n\n if (typeof modeOrCallbackOrOptions === 'function') {\n callback = modeOrCallbackOrOptions;\n } else if (typeof modeOrCallbackOrOptions === 'object') {\n const modeAsOptions = modeOrCallbackOrOptions as IPlayVoiceOverOptions;\n priority = modeAsOptions.priority ?? 0;\n callback = modeAsOptions.callback;\n mode = modeAsOptions.mode ?? 'override';\n if (modeAsOptions.localized) {\n locale = this.app.i18n.locale;\n key = key.map((k) => `${k}_${locale}`);\n }\n }\n\n if (typeof modeOrCallbackOrOptions === 'string') {\n mode = modeOrCallbackOrOptions;\n }\n this._paused = false;\n if (key.length === 1 && this._queue.length === 1 && this._queue[0].key === key[0]) {\n Logger.warn(`đ Skipped VO ${key[0]} because it is already playing`);\n if (callback) {\n callback(false);\n }\n } else if (\n this._queue.length === 0 ||\n (mode === 'override' && priority >= this._queue[0].priority!) ||\n (mode === 'new' && priority > this._queue[0].priority!)\n ) {\n await this.stopVO();\n this.addToQueue(key, callback, priority);\n return this.playNext();\n } else if (mode === 'append') {\n this.addToQueue(key, callback, priority);\n } else if (callback) {\n Logger.warn(`đđ Firing callback without playing VO(s) ${key.join(', ')}`);\n callback(false);\n } else {\n Logger.warn(`đ Skipped VO(s) ${key.join(', ')} because it is lower priority than what was already playing`);\n }\n }\n\n public async stopVO(): Promise<void> {\n const activeVO: IAudioInstance | undefined = this.activeVO;\n const activeItem: IQueueItem | undefined = this._queue[0];\n this._queue.splice(0, this._queue.length);\n this._pausedQueue.splice(0, this._pausedQueue.length);\n activeItem?.timeout?.kill();\n if (activeVO) {\n if (!activeVO.media) {\n Logger.warn(`đ Stopping VO %c%s%c while it is still loading ${activeVO.id}`);\n activeVO.remove();\n } else if (activeVO.isPlaying) {\n Logger.log(`đ¤Ģ Fading out VO ${activeVO.id} (duration:${this.fadeOutDuration})`);\n await activeVO.fadeTo(0, this.fadeOutDuration);\n activeVO.stop();\n } else {\n activeVO.stop();\n }\n } else {\n Logger.warn('đ No active VO to stop');\n this.activeTimeout?.kill();\n }\n this.clearSignalConnections();\n this._paused = false;\n this.onVoiceOverStopped.emit(activeVO);\n }\n\n pauseVO() {\n if (this._paused) return;\n if (this._queue.length > 0) {\n this._paused = true;\n this._pausedQueue.push(...this._queue);\n const activeVO = this.activeVO;\n const activeTimeout = this.activeTimeout;\n activeVO?.pause();\n activeTimeout?.pause();\n this._queue.splice(0, this._queue.length);\n }\n }\n\n resumeVO() {\n if (!this._paused) return;\n this._paused = false;\n if (this._pausedQueue.length > 0) {\n this._queue.push(...this._pausedQueue);\n this._pausedQueue.splice(0, this._pausedQueue.length);\n const activeVO = this.activeVO;\n const activeTimeout = this.activeTimeout;\n activeVO?.resume();\n activeTimeout?.resume();\n if (activeVO) {\n this.onVoiceOverStart.emit(activeVO);\n }\n }\n }\n\n protected getCoreSignals(): string[] {\n return ['onVoiceOverStart', 'onVoiceOverPaused', 'onVoiceOverComplete', 'onVoiceOverResumed', 'onVoiceOverStopped'];\n }\n\n private addToQueue(keys: VoKey[], cb?: VoCallback, priority?: number) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (typeof key === 'number') {\n Logger.log(`â Queueing delay ${key}`);\n } else {\n Logger.log(`â Queueing VO ${key}`);\n }\n\n this._queue.push({\n key: typeof key === 'string' ? key : '',\n delay: typeof key === 'number' ? key : undefined,\n callback: i === keys.length - 1 ? cb : undefined,\n priority,\n });\n }\n const toLoad = keys.filter((it) => typeof it === 'string') as string[];\n Logger.log(`đ Loading VO(s) ${toLoad.join(', ')}`);\n this.app.audio.load(toLoad, 'voiceover');\n }\n\n private async playNext(): Promise<IAudioInstance | void> {\n if (this._queue.length > 0) {\n const item = this._queue[0];\n if (item.delay !== undefined) {\n this.activeTimeout?.kill();\n if (this._queue.length === 1) {\n // skip delay if last item in queue\n Logger.log('â Skipping delay because there are no more items in queue');\n this._queue.shift();\n if (item.callback) {\n item.callback(true);\n }\n return this.playNext();\n } else {\n Logger.log('âŗ Waiting %s seconds before next VO', item.delay);\n item.timeout = gsap.delayedCall(item.delay, () => {\n this._queue.shift();\n if (item.callback) {\n item.callback(true);\n }\n return this.playNext();\n });\n }\n } else {\n const existing = this.app.audio.getAudioInstance(item.key, 'voiceover');\n if (existing) {\n if (existing.isPlaying) {\n Logger.warn('đ Stopping VO %c%s%c (no fade out)', existing.id);\n existing.stop();\n this.onVoiceOverComplete.emit(existing);\n }\n } else {\n Logger.log('đ Loading VO %c%s%c', item.key);\n }\n const instance = await this.app.audio.play(item.key, 'voiceover', { singleInstance: true });\n if (this.activeVO) {\n this.onVoiceOverStart.emit(this.activeVO);\n }\n if (this._queue[0] !== item) {\n return;\n }\n Logger.log(`âļī¸âļī¸ Playing VO ${item.key}`);\n Logger.log('âšī¸ Queue length:', this._queue.length);\n\n if (this.activeVO) {\n this.addSignalConnection(\n this.activeVO.onEnd.connectOnce(this._handleActiveVOEnded),\n this.activeVO.onPaused.connectOnce(this._handleActiveVOPaused),\n this.activeVO.onResumed.connectOnce(this._handleActiveVOResumed),\n this.activeVO.onStart.connectOnce(this._handleActiveVOStarted),\n );\n } else {\n Logger.error('â ī¸ Vo %c%s%c completed early (did not play?)', item.key);\n this._handleActiveVOEndedWithoutPlaying(instance);\n }\n return instance;\n }\n } else {\n Logger.log('â
Nothing left in queue');\n }\n }\n\n private _handleActiveVOStarted(instance: IAudioInstance) {\n this.onVoiceOverStart.emit(this.activeVO || instance);\n }\n\n private _handleActiveVOPaused(instance: IAudioInstance) {\n this.onVoiceOverPaused.emit(this.activeVO || instance);\n }\n\n private _handleActiveVOResumed(instance: IAudioInstance) {\n this.onVoiceOverResumed.emit(this.activeVO || instance);\n }\n\n private _handleActiveVOEndedWithoutPlaying(instance: IAudioInstance) {\n this.onVoiceOverComplete.emit(this.activeVO || instance);\n this.activeTimeout?.kill();\n this._currentItemCallback(false);\n this._queue.shift();\n this.playNext();\n }\n\n private _handleActiveVOEnded(instance: IAudioInstance) {\n this.onVoiceOverComplete.emit(this.activeVO || instance);\n this.activeTimeout?.kill();\n this._currentItemCallback();\n this._queue.shift();\n this.playNext();\n }\n\n private _currentItemCallback(didPlay: boolean = true) {\n const item = this._queue[0];\n if (!item) {\n return;\n }\n Logger.log(`đ Completed VO ${item.key}`);\n if (item.callback) {\n Logger.log(`'đ Firing callback for`, item.key);\n item.callback(didPlay);\n }\n }\n\n private onPause() {\n if (this.activeVO !== undefined && this.activeVO.isPlaying) {\n Logger.log('⸠Pausing VO', this.activeVO.id);\n this.activeVO.pause();\n this.onVoiceOverComplete.emit(this.activeVO);\n }\n this.activeTimeout?.pause();\n }\n\n private onResume() {\n if (this.activeVO !== undefined && !this.activeVO.isPlaying) {\n Logger.log('⯠Resuming VO', this.activeVO.id);\n this.activeVO.resume();\n this.onVoiceOverStart.emit(this.activeVO);\n }\n this.activeTimeout?.resume();\n }\n}\n"],"mappings":";;AAmDA,IAAa,IAAb,cAAqC,EAAmC;;yBACjD,oCACI,kBACV,4BACuD,IAAI,GAEvE,2BACoE,IAAI,GAExE,6BACsE,IAAI,GAE1E,4BACqE,IAAI,GAEzE,4BACsE,IAAI,GAE1E,gBACqC,EAAE,sBACI,EAAE,iBACrB;;CAE3B,IAAI,SAAS;AACX,SAAO,KAAK;;CAGd,IAAI,gBAA6C;AAC/C,SAAO,KAAK,OAAO,IAAI;;CAGzB,IAAI,WAAuC;AACzC,MAAI,KAAK,OAAO,SAAS,KAAK,KAAK,OAAO,GAAG,IAC3C,QAAO,KAAK,IAAI,MAAM,iBAAiB,KAAK,OAAO,GAAG,KAAK,YAAY;;CAK3E,MAAM,aAAa;AAGjB,EAFA,KAAK,IAAI,QAAQ,QAAQ,CAAC,QAAQ,KAAK,QAAQ,EAC/C,KAAK,IAAI,QAAQ,UAAU,CAAC,QAAQ,KAAK,SAAS,EAClD,KAAK,IAAI,OAAO,mBAAmB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