brick-engine-js 1.0.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.
- package/.env.local.example +2 -0
- package/.github/workflows/publish.yml +73 -0
- package/.prettierignore +2 -0
- package/.prettierrc.json +8 -0
- package/README.adoc +84 -0
- package/dist/8e23286c2fdf41fd795f.svg +32 -0
- package/dist/CNAME +1 -0
- package/dist/app.js +2 -0
- package/dist/app.js.map +1 -0
- package/dist/brick-engine.js +2 -0
- package/dist/brick-engine.js.map +1 -0
- package/dist/config/configs.d.ts +180 -0
- package/dist/config/configs.test.d.ts +1 -0
- package/dist/config/env.d.ts +2 -0
- package/dist/config/env.test.d.ts +1 -0
- package/dist/config/styles.d.ts +0 -0
- package/dist/core/Game.d.ts +107 -0
- package/dist/core/Game.test.d.ts +1 -0
- package/dist/core/InitialStateSnapshot.d.ts +19 -0
- package/dist/core/InitialStateSnapshot.test.d.ts +1 -0
- package/dist/core/helpers/CellHelper.d.ts +13 -0
- package/dist/core/helpers/CellHelper.test.d.ts +1 -0
- package/dist/core/helpers/ControlInputHandlerHelper.d.ts +32 -0
- package/dist/core/helpers/ControlInputHandlerHelper.test.d.ts +1 -0
- package/dist/core/helpers/CoordinateHelper.d.ts +54 -0
- package/dist/core/helpers/CoordinateHelper.test.d.ts +1 -0
- package/dist/core/helpers/InterfaceIdentifierHelper.d.ts +7 -0
- package/dist/core/helpers/InterfaceIdentifierHelper.test.d.ts +1 -0
- package/dist/core/helpers/RelativeValuesHelper.d.ts +23 -0
- package/dist/core/helpers/RelativeValuesHelper.test.d.ts +1 -0
- package/dist/core/module/control/GameControl.d.ts +62 -0
- package/dist/core/module/control/GameControl.test.d.ts +1 -0
- package/dist/core/module/control/GameControlKeyBinding.d.ts +36 -0
- package/dist/core/module/control/GameControlKeyBinding.test.d.ts +1 -0
- package/dist/core/module/grid/GameGrid.d.ts +399 -0
- package/dist/core/module/grid/GameGrid.test.d.ts +1 -0
- package/dist/core/module/grid/GameHudGrid.d.ts +24 -0
- package/dist/core/module/grid/GameHudGrid.test.d.ts +1 -0
- package/dist/core/module/grid/engines/GridAnalysisEngine.d.ts +29 -0
- package/dist/core/module/grid/engines/GridAnalysisEngine.test.d.ts +1 -0
- package/dist/core/module/grid/engines/GridLineEngine.d.ts +56 -0
- package/dist/core/module/grid/engines/GridLineEngine.test.d.ts +1 -0
- package/dist/core/module/grid/engines/GridMovementEngine.d.ts +29 -0
- package/dist/core/module/grid/engines/GridMovementEngine.test.d.ts +1 -0
- package/dist/core/module/grid/engines/GridRegionEngine.d.ts +26 -0
- package/dist/core/module/grid/engines/GridRegionEngine.test.d.ts +1 -0
- package/dist/core/module/grid/engines/GridTransformEngine.d.ts +24 -0
- package/dist/core/module/grid/engines/GridTransformEngine.test.d.ts +1 -0
- package/dist/core/module/renderer/DisplayRenderer.d.ts +51 -0
- package/dist/core/module/renderer/DisplayRenderer.test.d.ts +1 -0
- package/dist/core/module/renderer/GameRenderer.d.ts +59 -0
- package/dist/core/module/renderer/GameRenderer.test.d.ts +1 -0
- package/dist/core/module/renderer/HudRenderer.d.ts +56 -0
- package/dist/core/module/renderer/HudRenderer.test.d.ts +1 -0
- package/dist/core/module/score/GameScore.d.ts +117 -0
- package/dist/core/module/score/GameScore.test.d.ts +1 -0
- package/dist/core/module/session/GameSession.d.ts +20 -0
- package/dist/core/module/session/GameSession.test.d.ts +1 -0
- package/dist/core/module/sound/GameSound.d.ts +85 -0
- package/dist/core/module/sound/GameSound.test.d.ts +1 -0
- package/dist/core/module/state/GameState.d.ts +172 -0
- package/dist/core/module/state/GameState.test.d.ts +1 -0
- package/dist/core/module/text/GameText.d.ts +87 -0
- package/dist/core/module/text/GameText.test.d.ts +1 -0
- package/dist/core/module/time/GameTime.d.ts +76 -0
- package/dist/core/module/time/GameTime.test.d.ts +1 -0
- package/dist/core/types/Interfaces.d.ts +53 -0
- package/dist/core/types/Types.d.ts +114 -0
- package/dist/core/types/enums.d.ts +106 -0
- package/dist/core/types/modules.d.ts +723 -0
- package/dist/css/app.743066d8e4172b0e73f9.css +824 -0
- package/dist/css/app.743066d8e4172b0e73f9.css.map +1 -0
- package/dist/docs/GAME_DEVELOPER_GUIDE.html +727 -0
- package/dist/docs/brick-engine-guide.html +610 -0
- package/dist/docs/diagrams/lifecycle.mmd +19 -0
- package/dist/docs/documentation_style_guide.html +994 -0
- package/dist/docs/getting-started.html +648 -0
- package/dist/docs/images/lifecycle.svg +1 -0
- package/dist/docs/index.html +593 -0
- package/dist/docs/jsdoc_standard.html +656 -0
- package/dist/docs/publishing.html +573 -0
- package/dist/docs/reference/enums/Color.html +533 -0
- package/dist/docs/reference/enums/ControlEventType.html +505 -0
- package/dist/docs/reference/enums/ControlKey.html +529 -0
- package/dist/docs/reference/enums/FontAlignment.html +545 -0
- package/dist/docs/reference/enums/FontSize.html +517 -0
- package/dist/docs/reference/enums/Sound.html +558 -0
- package/dist/docs/reference/enums/StateProperty.html +525 -0
- package/dist/docs/reference/helpers/CellHelper.html +520 -0
- package/dist/docs/reference/helpers/ControlInputHandlerHelper.html +569 -0
- package/dist/docs/reference/helpers/CoordinateHelper.html +703 -0
- package/dist/docs/reference/helpers/RelativeValuesHelper.html +560 -0
- package/dist/docs/reference/interfaces/Debuggable.html +501 -0
- package/dist/docs/reference/interfaces/GameModules.html +544 -0
- package/dist/docs/reference/interfaces/Initializable.html +495 -0
- package/dist/docs/reference/interfaces/RendererInitializable.html +517 -0
- package/dist/docs/reference/interfaces/StateSyncable.html +542 -0
- package/dist/docs/reference/interfaces/modules/Control.html +648 -0
- package/dist/docs/reference/interfaces/modules/Grid.html +1256 -0
- package/dist/docs/reference/interfaces/modules/Renderer.html +522 -0
- package/dist/docs/reference/interfaces/modules/RendererComposite.html +577 -0
- package/dist/docs/reference/interfaces/modules/Score.html +669 -0
- package/dist/docs/reference/interfaces/modules/Session.html +585 -0
- package/dist/docs/reference/interfaces/modules/State.html +897 -0
- package/dist/docs/reference/interfaces/modules/Text.html +668 -0
- package/dist/docs/reference/interfaces/modules/Time.html +684 -0
- package/dist/docs/reference/modules/Debugger.html +579 -0
- package/dist/docs/reference/modules/DisplayRenderer.html +557 -0
- package/dist/docs/reference/modules/Game.html +909 -0
- package/dist/docs/reference/modules/GameControl.html +716 -0
- package/dist/docs/reference/modules/GameGrid.html +1910 -0
- package/dist/docs/reference/modules/GameHudGrid.html +508 -0
- package/dist/docs/reference/modules/GameMenu.html +538 -0
- package/dist/docs/reference/modules/GameRenderer.html +589 -0
- package/dist/docs/reference/modules/GameScore.html +664 -0
- package/dist/docs/reference/modules/GameSession.html +533 -0
- package/dist/docs/reference/modules/GameSound.html +636 -0
- package/dist/docs/reference/modules/GameState.html +922 -0
- package/dist/docs/reference/modules/GameText.html +701 -0
- package/dist/docs/reference/modules/GameTime.html +696 -0
- package/dist/docs/reference/modules/HudRenderer.html +568 -0
- package/dist/docs/reference/modules/InitialStateSnapshot.html +557 -0
- package/dist/docs/reference/modules/SessionModal.html +520 -0
- package/dist/docs/reference/types/Axis.html +505 -0
- package/dist/docs/reference/types/Cell.html +514 -0
- package/dist/docs/reference/types/ControlCallback.html +488 -0
- package/dist/docs/reference/types/Coordinate.html +510 -0
- package/dist/docs/reference/types/GameEntry.html +514 -0
- package/dist/docs/reference/types/GameEvent.html +514 -0
- package/dist/docs/reference/types/Piece.html +506 -0
- package/dist/docs/reference/types/RendererMetrics.html +514 -0
- package/dist/docs/reference/types/Vector.html +509 -0
- package/dist/docs/testing_best_practices.html +770 -0
- package/dist/favicon.ico +0 -0
- package/dist/fonts/digital-7.monoitalic.ttf +0 -0
- package/dist/images/cell.svg +32 -0
- package/dist/images/close.png +0 -0
- package/dist/images/games.png +0 -0
- package/dist/images/github.png +0 -0
- package/dist/images/letter-a.png +0 -0
- package/dist/images/letter-d.png +0 -0
- package/dist/images/letter-j.png +0 -0
- package/dist/images/letter-s.png +0 -0
- package/dist/images/letter-w.png +0 -0
- package/dist/images/meta-image.png +0 -0
- package/dist/images/number-1.png +0 -0
- package/dist/images/number-2.png +0 -0
- package/dist/images/number-3.png +0 -0
- package/dist/images/number-4.png +0 -0
- package/dist/images/number-5.png +0 -0
- package/dist/images/number-6.png +0 -0
- package/dist/images/splash.gif +0 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.html +1 -0
- package/dist/index.test.d.ts +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.test.d.ts +1 -0
- package/dist/menu/GameMenu.d.ts +15 -0
- package/dist/menu/GameMenu.test.d.ts +1 -0
- package/dist/menu/GameMenuSingleton.d.ts +6 -0
- package/dist/menu/GameMenuSingleton.test.d.ts +1 -0
- package/dist/menu/GameRepository.d.ts +7 -0
- package/dist/menu/GameRepository.test.d.ts +1 -0
- package/dist/menu/manager/GameManager.d.ts +6 -0
- package/dist/menu/manager/GameManager.test.d.ts +1 -0
- package/dist/sounds/sound_00.wav +0 -0
- package/dist/sounds/sound_01.wav +0 -0
- package/dist/sounds/sound_02.wav +0 -0
- package/dist/sounds/sound_03.wav +0 -0
- package/dist/sounds/sound_04.wav +0 -0
- package/dist/sounds/sound_05.wav +0 -0
- package/dist/sounds/sound_06.wav +0 -0
- package/dist/sounds/sound_07.wav +0 -0
- package/dist/sounds/sound_08.wav +0 -0
- package/dist/sounds/sound_09.wav +0 -0
- package/dist/sounds/sound_10.wav +0 -0
- package/dist/sounds/sound_11.wav +0 -0
- package/dist/sounds/sound_12.wav +0 -0
- package/dist/sounds/sound_13.wav +0 -0
- package/dist/sounds/sound_14.wav +0 -0
- package/dist/sounds/sound_15.wav +0 -0
- package/dist/types/interfaces.d.ts +5 -0
- package/dist/vendor/p5.min.js +1 -0
- package/dist/view/Debugger.d.ts +12 -0
- package/dist/view/Debugger.test.d.ts +1 -0
- package/dist/view/GameView.d.ts +101 -0
- package/dist/view/GameView.test.d.ts +1 -0
- package/dist/view/SessionModal.d.ts +12 -0
- package/dist/view/SessionModal.test.d.ts +4 -0
- package/dist/view/components/layout/ButtonLayout.d.ts +25 -0
- package/dist/view/components/layout/ButtonLayout.test.d.ts +1 -0
- package/dist/view/components/layout/ContainerLayout.d.ts +23 -0
- package/dist/view/components/layout/ContainerLayout.test.d.ts +1 -0
- package/dist/view/components/layout/FrameLayout.d.ts +11 -0
- package/dist/view/components/layout/FrameLayout.test.d.ts +1 -0
- package/dist/view/components/ui/BigButton.d.ts +13 -0
- package/dist/view/components/ui/BigButton.test.d.ts +1 -0
- package/dist/view/components/ui/Button.d.ts +12 -0
- package/dist/view/components/ui/Button.test.d.ts +1 -0
- package/dist/view/components/ui/Canvas.d.ts +22 -0
- package/dist/view/components/ui/Canvas.test.d.ts +1 -0
- package/dist/view/components/ui/SmallButton.d.ts +13 -0
- package/dist/view/components/ui/SmallButton.test.d.ts +1 -0
- package/dist/view/theme/applyColors.d.ts +10 -0
- package/dist/view/theme/applyColors.test.d.ts +1 -0
- package/dist/view/theme/dimensions.d.ts +13 -0
- package/dist/view/theme/dimensions.test.d.ts +1 -0
- package/docs/GAME_DEVELOPER_GUIDE.adoc +167 -0
- package/docs/brick-engine-guide.adoc +87 -0
- package/docs/diagrams/lifecycle.mmd +19 -0
- package/docs/documentation_style_guide.adoc +210 -0
- package/docs/getting-started.adoc +147 -0
- package/docs/images/lifecycle.svg +1 -0
- package/docs/jsdoc_standard.adoc +109 -0
- package/docs/publishing.adoc +58 -0
- package/docs/reference/enums/Color.adoc +35 -0
- package/docs/reference/enums/ControlEventType.adoc +28 -0
- package/docs/reference/enums/ControlKey.adoc +34 -0
- package/docs/reference/enums/FontAlignment.adoc +43 -0
- package/docs/reference/enums/FontSize.adoc +31 -0
- package/docs/reference/enums/Sound.adoc +42 -0
- package/docs/reference/enums/StateProperty.adoc +33 -0
- package/docs/reference/helpers/CellHelper.adoc +37 -0
- package/docs/reference/helpers/ControlInputHandlerHelper.adoc +57 -0
- package/docs/reference/helpers/CoordinateHelper.adoc +118 -0
- package/docs/reference/helpers/RelativeValuesHelper.adoc +53 -0
- package/docs/reference/interfaces/Debuggable.adoc +29 -0
- package/docs/reference/interfaces/GameModules.adoc +35 -0
- package/docs/reference/interfaces/Initializable.adoc +24 -0
- package/docs/reference/interfaces/RendererInitializable.adoc +33 -0
- package/docs/reference/interfaces/StateSyncable.adoc +41 -0
- package/docs/reference/interfaces/modules/Control.adoc +98 -0
- package/docs/reference/interfaces/modules/Grid.adoc +411 -0
- package/docs/reference/interfaces/modules/Renderer.adoc +34 -0
- package/docs/reference/interfaces/modules/RendererComposite.adoc +57 -0
- package/docs/reference/interfaces/modules/Score.adoc +107 -0
- package/docs/reference/interfaces/modules/Session.adoc +66 -0
- package/docs/reference/interfaces/modules/State.adoc +290 -0
- package/docs/reference/interfaces/modules/Text.adoc +110 -0
- package/docs/reference/interfaces/modules/Time.adoc +119 -0
- package/docs/reference/modules/Debugger.adoc +71 -0
- package/docs/reference/modules/DisplayRenderer.adoc +55 -0
- package/docs/reference/modules/Game.adoc +256 -0
- package/docs/reference/modules/GameControl.adoc +139 -0
- package/docs/reference/modules/GameGrid.adoc +794 -0
- package/docs/reference/modules/GameHudGrid.adoc +38 -0
- package/docs/reference/modules/GameMenu.adoc +39 -0
- package/docs/reference/modules/GameRenderer.adoc +79 -0
- package/docs/reference/modules/GameScore.adoc +138 -0
- package/docs/reference/modules/GameSession.adoc +43 -0
- package/docs/reference/modules/GameSound.adoc +111 -0
- package/docs/reference/modules/GameState.adoc +318 -0
- package/docs/reference/modules/GameText.adoc +139 -0
- package/docs/reference/modules/GameTime.adoc +141 -0
- package/docs/reference/modules/HudRenderer.adoc +56 -0
- package/docs/reference/modules/InitialStateSnapshot.adoc +47 -0
- package/docs/reference/modules/SessionModal.adoc +34 -0
- package/docs/reference/types/Axis.adoc +28 -0
- package/docs/reference/types/Cell.adoc +29 -0
- package/docs/reference/types/ControlCallback.adoc +23 -0
- package/docs/reference/types/Coordinate.adoc +29 -0
- package/docs/reference/types/GameEntry.adoc +29 -0
- package/docs/reference/types/GameEvent.adoc +29 -0
- package/docs/reference/types/Piece.adoc +32 -0
- package/docs/reference/types/RendererMetrics.adoc +29 -0
- package/docs/reference/types/Vector.adoc +28 -0
- package/docs/testing_best_practices.adoc +190 -0
- package/eslint.config.mjs +29 -0
- package/package.json +54 -0
- package/public/CNAME +1 -0
- package/public/docs/GAME_DEVELOPER_GUIDE.html +727 -0
- package/public/docs/brick-engine-guide.html +610 -0
- package/public/docs/diagrams/lifecycle.mmd +19 -0
- package/public/docs/documentation_style_guide.html +994 -0
- package/public/docs/getting-started.html +648 -0
- package/public/docs/images/lifecycle.svg +1 -0
- package/public/docs/index.html +593 -0
- package/public/docs/jsdoc_standard.html +656 -0
- package/public/docs/publishing.html +573 -0
- package/public/docs/reference/enums/Color.html +533 -0
- package/public/docs/reference/enums/ControlEventType.html +505 -0
- package/public/docs/reference/enums/ControlKey.html +529 -0
- package/public/docs/reference/enums/FontAlignment.html +545 -0
- package/public/docs/reference/enums/FontSize.html +517 -0
- package/public/docs/reference/enums/Sound.html +558 -0
- package/public/docs/reference/enums/StateProperty.html +525 -0
- package/public/docs/reference/helpers/CellHelper.html +520 -0
- package/public/docs/reference/helpers/ControlInputHandlerHelper.html +569 -0
- package/public/docs/reference/helpers/CoordinateHelper.html +703 -0
- package/public/docs/reference/helpers/RelativeValuesHelper.html +560 -0
- package/public/docs/reference/interfaces/Debuggable.html +501 -0
- package/public/docs/reference/interfaces/GameModules.html +544 -0
- package/public/docs/reference/interfaces/Initializable.html +495 -0
- package/public/docs/reference/interfaces/RendererInitializable.html +517 -0
- package/public/docs/reference/interfaces/StateSyncable.html +542 -0
- package/public/docs/reference/interfaces/modules/Control.html +648 -0
- package/public/docs/reference/interfaces/modules/Grid.html +1256 -0
- package/public/docs/reference/interfaces/modules/Renderer.html +522 -0
- package/public/docs/reference/interfaces/modules/RendererComposite.html +577 -0
- package/public/docs/reference/interfaces/modules/Score.html +669 -0
- package/public/docs/reference/interfaces/modules/Session.html +585 -0
- package/public/docs/reference/interfaces/modules/State.html +897 -0
- package/public/docs/reference/interfaces/modules/Text.html +668 -0
- package/public/docs/reference/interfaces/modules/Time.html +684 -0
- package/public/docs/reference/modules/Debugger.html +579 -0
- package/public/docs/reference/modules/DisplayRenderer.html +557 -0
- package/public/docs/reference/modules/Game.html +909 -0
- package/public/docs/reference/modules/GameControl.html +716 -0
- package/public/docs/reference/modules/GameGrid.html +1910 -0
- package/public/docs/reference/modules/GameHudGrid.html +508 -0
- package/public/docs/reference/modules/GameMenu.html +538 -0
- package/public/docs/reference/modules/GameRenderer.html +589 -0
- package/public/docs/reference/modules/GameScore.html +664 -0
- package/public/docs/reference/modules/GameSession.html +533 -0
- package/public/docs/reference/modules/GameSound.html +636 -0
- package/public/docs/reference/modules/GameState.html +922 -0
- package/public/docs/reference/modules/GameText.html +701 -0
- package/public/docs/reference/modules/GameTime.html +696 -0
- package/public/docs/reference/modules/HudRenderer.html +568 -0
- package/public/docs/reference/modules/InitialStateSnapshot.html +557 -0
- package/public/docs/reference/modules/SessionModal.html +520 -0
- package/public/docs/reference/types/Axis.html +505 -0
- package/public/docs/reference/types/Cell.html +514 -0
- package/public/docs/reference/types/ControlCallback.html +488 -0
- package/public/docs/reference/types/Coordinate.html +510 -0
- package/public/docs/reference/types/GameEntry.html +514 -0
- package/public/docs/reference/types/GameEvent.html +514 -0
- package/public/docs/reference/types/Piece.html +506 -0
- package/public/docs/reference/types/RendererMetrics.html +514 -0
- package/public/docs/reference/types/Vector.html +509 -0
- package/public/docs/testing_best_practices.html +770 -0
- package/public/favicon.ico +0 -0
- package/public/fonts/digital-7.monoitalic.ttf +0 -0
- package/public/images/cell.svg +32 -0
- package/public/images/close.png +0 -0
- package/public/images/games.png +0 -0
- package/public/images/github.png +0 -0
- package/public/images/letter-a.png +0 -0
- package/public/images/letter-d.png +0 -0
- package/public/images/letter-j.png +0 -0
- package/public/images/letter-s.png +0 -0
- package/public/images/letter-w.png +0 -0
- package/public/images/meta-image.png +0 -0
- package/public/images/number-1.png +0 -0
- package/public/images/number-2.png +0 -0
- package/public/images/number-3.png +0 -0
- package/public/images/number-4.png +0 -0
- package/public/images/number-5.png +0 -0
- package/public/images/number-6.png +0 -0
- package/public/images/splash.gif +0 -0
- package/public/index.html +15 -0
- package/public/sounds/sound_00.wav +0 -0
- package/public/sounds/sound_01.wav +0 -0
- package/public/sounds/sound_02.wav +0 -0
- package/public/sounds/sound_03.wav +0 -0
- package/public/sounds/sound_04.wav +0 -0
- package/public/sounds/sound_05.wav +0 -0
- package/public/sounds/sound_06.wav +0 -0
- package/public/sounds/sound_07.wav +0 -0
- package/public/sounds/sound_08.wav +0 -0
- package/public/sounds/sound_09.wav +0 -0
- package/public/sounds/sound_10.wav +0 -0
- package/public/sounds/sound_11.wav +0 -0
- package/public/sounds/sound_12.wav +0 -0
- package/public/sounds/sound_13.wav +0 -0
- package/public/sounds/sound_14.wav +0 -0
- package/public/sounds/sound_15.wav +0 -0
- package/public/style/body.css +86 -0
- package/public/style/buttons.css +233 -0
- package/public/style/debugger.css +117 -0
- package/public/style/sessionModal.css +155 -0
- package/public/style/sourceCodeAndCommands.css +74 -0
- package/public/style/splash.css +13 -0
- package/public/style/theme.css +137 -0
- package/scripts/generate-diagrams.sh +20 -0
- package/scripts/generate-docs.js +111 -0
- package/src/client-game.d.ts +1 -0
- package/src/config/configs.test.ts +20 -0
- package/src/config/configs.ts +197 -0
- package/src/config/env.test.ts +59 -0
- package/src/config/env.ts +7 -0
- package/src/config/styles.ts +5 -0
- package/src/core/Game.test.ts +167 -0
- package/src/core/Game.ts +307 -0
- package/src/core/InitialStateSnapshot.test.ts +51 -0
- package/src/core/InitialStateSnapshot.ts +46 -0
- package/src/core/helpers/CellHelper.test.ts +33 -0
- package/src/core/helpers/CellHelper.ts +21 -0
- package/src/core/helpers/ControlInputHandlerHelper.test.ts +116 -0
- package/src/core/helpers/ControlInputHandlerHelper.ts +68 -0
- package/src/core/helpers/CoordinateHelper.test.ts +113 -0
- package/src/core/helpers/CoordinateHelper.ts +82 -0
- package/src/core/helpers/InterfaceIdentifierHelper.test.ts +122 -0
- package/src/core/helpers/InterfaceIdentifierHelper.ts +43 -0
- package/src/core/helpers/RelativeValuesHelper.test.ts +47 -0
- package/src/core/helpers/RelativeValuesHelper.ts +29 -0
- package/src/core/module/control/GameControl.test.ts +82 -0
- package/src/core/module/control/GameControl.ts +142 -0
- package/src/core/module/control/GameControlKeyBinding.test.ts +59 -0
- package/src/core/module/control/GameControlKeyBinding.ts +92 -0
- package/src/core/module/grid/GameGrid.test.ts +83 -0
- package/src/core/module/grid/GameGrid.ts +610 -0
- package/src/core/module/grid/GameHudGrid.test.ts +22 -0
- package/src/core/module/grid/GameHudGrid.ts +40 -0
- package/src/core/module/grid/engines/GridAnalysisEngine.test.ts +157 -0
- package/src/core/module/grid/engines/GridAnalysisEngine.ts +124 -0
- package/src/core/module/grid/engines/GridLineEngine.test.ts +132 -0
- package/src/core/module/grid/engines/GridLineEngine.ts +165 -0
- package/src/core/module/grid/engines/GridMovementEngine.test.ts +125 -0
- package/src/core/module/grid/engines/GridMovementEngine.ts +113 -0
- package/src/core/module/grid/engines/GridRegionEngine.test.ts +136 -0
- package/src/core/module/grid/engines/GridRegionEngine.ts +52 -0
- package/src/core/module/grid/engines/GridTransformEngine.test.ts +98 -0
- package/src/core/module/grid/engines/GridTransformEngine.ts +70 -0
- package/src/core/module/renderer/DisplayRenderer.test.ts +86 -0
- package/src/core/module/renderer/DisplayRenderer.ts +152 -0
- package/src/core/module/renderer/GameRenderer.test.ts +103 -0
- package/src/core/module/renderer/GameRenderer.ts +144 -0
- package/src/core/module/renderer/HudRenderer.test.ts +108 -0
- package/src/core/module/renderer/HudRenderer.ts +203 -0
- package/src/core/module/score/GameScore.test.ts +71 -0
- package/src/core/module/score/GameScore.ts +188 -0
- package/src/core/module/session/GameSession.test.ts +176 -0
- package/src/core/module/session/GameSession.ts +103 -0
- package/src/core/module/sound/GameSound.test.ts +117 -0
- package/src/core/module/sound/GameSound.ts +229 -0
- package/src/core/module/state/GameState.test.ts +101 -0
- package/src/core/module/state/GameState.ts +339 -0
- package/src/core/module/text/GameText.test.ts +87 -0
- package/src/core/module/text/GameText.ts +150 -0
- package/src/core/module/time/GameTime.test.ts +86 -0
- package/src/core/module/time/GameTime.ts +144 -0
- package/src/core/types/Interfaces.ts +59 -0
- package/src/core/types/Types.ts +124 -0
- package/src/core/types/enums.ts +113 -0
- package/src/core/types/modules.ts +841 -0
- package/src/index.test.ts +15 -0
- package/src/index.ts +9 -0
- package/src/main.test.ts +137 -0
- package/src/main.ts +77 -0
- package/src/menu/GameMenu.test.ts +157 -0
- package/src/menu/GameMenu.ts +124 -0
- package/src/menu/GameMenuSingleton.test.ts +26 -0
- package/src/menu/GameMenuSingleton.ts +13 -0
- package/src/menu/GameRepository.test.ts +46 -0
- package/src/menu/GameRepository.ts +47 -0
- package/src/menu/manager/GameManager.test.ts +68 -0
- package/src/menu/manager/GameManager.ts +50 -0
- package/src/types/global.d.ts +8 -0
- package/src/types/interfaces.ts +5 -0
- package/src/view/Debugger.test.ts +152 -0
- package/src/view/Debugger.ts +124 -0
- package/src/view/GameView.test.ts +95 -0
- package/src/view/GameView.ts +244 -0
- package/src/view/SessionModal.test.ts +141 -0
- package/src/view/SessionModal.ts +73 -0
- package/src/view/components/layout/ButtonLayout.test.ts +28 -0
- package/src/view/components/layout/ButtonLayout.ts +63 -0
- package/src/view/components/layout/ContainerLayout.test.ts +48 -0
- package/src/view/components/layout/ContainerLayout.ts +50 -0
- package/src/view/components/layout/FrameLayout.test.ts +24 -0
- package/src/view/components/layout/FrameLayout.ts +25 -0
- package/src/view/components/ui/BigButton.test.ts +28 -0
- package/src/view/components/ui/BigButton.ts +31 -0
- package/src/view/components/ui/Button.test.ts +30 -0
- package/src/view/components/ui/Button.ts +30 -0
- package/src/view/components/ui/Canvas.test.ts +32 -0
- package/src/view/components/ui/Canvas.ts +34 -0
- package/src/view/components/ui/SmallButton.test.ts +48 -0
- package/src/view/components/ui/SmallButton.ts +32 -0
- package/src/view/theme/applyColors.test.ts +47 -0
- package/src/view/theme/applyColors.ts +38 -0
- package/src/view/theme/dimensions.test.ts +34 -0
- package/src/view/theme/dimensions.ts +53 -0
- package/tsconfig.json +16 -0
- package/vitest.config.ts +14 -0
- package/webpack.config.js +133 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brick-engine.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAqB,YAAID,IAEzBD,EAAkB,YAAIC,GACvB,CATD,CASGK,KAAM,I,mBCRT,ICEWC,EAeAC,EAaAC,EAWAC,EAaAC,EAsBAC,EAiBAC,EAWAC,EDxGPC,EAAsB,CEA1BA,EAAwB,CAACb,EAASc,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAEhB,EAASe,IAC5EE,OAAOC,eAAelB,EAASe,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFT,EAAyBb,IACH,oBAAX0B,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAelB,EAAS0B,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAelB,EAAS,aAAc,CAAE4B,OAAO,M,0MHDvD,SAAWvB,GACPA,EAAe,QAAI,kBACnBA,EAAY,KAAI,iBAChBA,EAAY,KAAI,mBAChBA,EAAY,KAAI,qBAChBA,EAAa,MAAI,iBACjBA,EAAc,OAAI,mBAClBA,EAAW,IAAI,iBACfA,EAAc,OAAI,mBAClBA,EAAgB,SAAI,oBACvB,CAVD,CAUGA,IAAUA,EAAQ,CAAC,IAKtB,SAAWC,GAEPA,EAAkB,OAAI,SAEtBA,EAAgB,KAAI,OAEpBA,EAAiB,MAAI,OACxB,CAPD,CAOGA,IAAc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cAAc,WAAc,GACzEjuB,KAAKmtB,SAASpC,aAAa,WAAc,GAAGkD,cAAc,WAAc,GACxEjuB,KAAKstB,WAAWvC,aAAa,WAAc,GAAGkD,cAAc,WAAc,EAC9E,EAOA/C,EAAS7wB,UAAU2zB,kBAAoB,SAAUE,EAAKr0B,GAClD,IAAIwG,EAAQL,KACZkuB,EAAInD,aAAa,WAAc,OAAO1qB,EAAM8C,cAAc/C,YAAYvG,EAAM,GAC5Eq0B,EAAID,cAAc,WAAc,OAAO5tB,EAAM8C,cAAchC,cAActH,EAAM,GAE/Eq0B,EAAIC,SAAS,WAAc,OAAO9tB,EAAM8C,cAAchC,cAActH,EAAM,EAC9E,EAMAqxB,EAAS7wB,UAAUmzB,YAAc,SAAUtsB,QACpB,IAAfA,IAAoBA,EAAQJ,EAAQ1E,WAAWM,mBACnD,IAAIsB,EAASwtB,SAASC,cAAc3qB,EAAQhD,UAAUE,QACtD0C,WAAW,WACP1C,EAAO8tB,MAAMxwB,QAAU,MAC3B,EAAG4F,EACP,EACOgqB,CACX,CA/J6B,GAgK7B,Y","sources":["webpack://BrickEngine/webpack/universalModuleDefinition","webpack://BrickEngine/webpack/bootstrap","webpack://BrickEngine/./src/core/types/enums.ts","webpack://BrickEngine/webpack/runtime/define property getters","webpack://BrickEngine/webpack/runtime/hasOwnProperty shorthand","webpack://BrickEngine/webpack/runtime/make namespace object","webpack://BrickEngine/./src/config/configs.ts","webpack://BrickEngine/./src/core/helpers/ControlInputHandlerHelper.ts","webpack://BrickEngine/./src/core/module/control/GameControlKeyBinding.ts","webpack://BrickEngine/./src/core/module/control/GameControl.ts","webpack://BrickEngine/./src/core/helpers/CellHelper.ts","webpack://BrickEngine/./src/core/module/grid/engines/GridMovementEngine.ts","webpack://BrickEngine/./src/core/module/grid/engines/GridTransformEngine.ts","webpack://BrickEngine/./src/core/module/grid/engines/GridAnalysisEngine.ts","webpack://BrickEngine/./src/core/module/grid/engines/GridLineEngine.ts","webpack://BrickEngine/./src/core/module/grid/engines/GridRegionEngine.ts","webpack://BrickEngine/./src/core/module/grid/GameGrid.ts","webpack://BrickEngine/./src/core/helpers/RelativeValuesHelper.ts","webpack://BrickEngine/./src/core/module/renderer/DisplayRenderer.ts","webpack://BrickEngine/./src/core/helpers/CoordinateHelper.ts","webpack://BrickEngine/./src/core/module/renderer/HudRenderer.ts","webpack://BrickEngine/./src/core/module/renderer/GameRenderer.ts","webpack://BrickEngine/./src/core/module/state/GameState.ts","webpack://BrickEngine/./src/core/module/text/GameText.ts","webpack://BrickEngine/./src/core/module/time/GameTime.ts","webpack://BrickEngine/./src/core/module/sound/GameSound.ts","webpack://BrickEngine/./src/core/module/score/GameScore.ts","webpack://BrickEngine/./src/core/module/grid/GameHudGrid.ts","webpack://BrickEngine/./src/core/helpers/InterfaceIdentifierHelper.ts","webpack://BrickEngine/./src/core/InitialStateSnapshot.ts","webpack://BrickEngine/./src/core/module/session/GameSession.ts","webpack://BrickEngine/./src/core/Game.ts","webpack://BrickEngine/./node_modules/colord/index.mjs","webpack://BrickEngine/./src/view/components/ui/Button.ts","webpack://BrickEngine/./src/view/components/ui/SmallButton.ts","webpack://BrickEngine/./src/view/Debugger.ts","webpack://BrickEngine/./src/view/SessionModal.ts","webpack://BrickEngine/./src/view/GameView.ts","webpack://BrickEngine/./src/view/theme/applyColors.ts","webpack://BrickEngine/./src/view/components/layout/ContainerLayout.ts","webpack://BrickEngine/./src/view/components/layout/FrameLayout.ts","webpack://BrickEngine/./src/view/components/ui/Canvas.ts","webpack://BrickEngine/./src/view/components/layout/ButtonLayout.ts","webpack://BrickEngine/./src/view/components/ui/BigButton.ts","webpack://BrickEngine/./src/view/theme/dimensions.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"BrickEngine\"] = factory();\n\telse\n\t\troot[\"BrickEngine\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","/**\n * Enumerates all available colors for grid cells and UI elements.\n */\nexport var Color;\n(function (Color) {\n Color[\"DEFAULT\"] = \"rgb(19, 26, 18)\";\n Color[\"BLUE\"] = \"rgb(0, 0, 128)\";\n Color[\"CYAN\"] = \"rgb(0, 128, 128)\";\n Color[\"GRAY\"] = \"rgb(128, 128, 128)\";\n Color[\"GREEN\"] = \"rgb(0, 128, 0)\";\n Color[\"PURPLE\"] = \"rgb(128, 0, 128)\";\n Color[\"RED\"] = \"rgb(128, 0, 0)\";\n Color[\"YELLOW\"] = \"rgb(128, 128, 0)\";\n Color[\"INACTIVE\"] = \"rgb(166, 183, 165)\";\n})(Color || (Color = {}));\n/**\n * Enumerates all available horizontal text alignments.\n */\nexport var FontAlign;\n(function (FontAlign) {\n /** Aligns text to the center. */\n FontAlign[\"CENTER\"] = \"center\";\n /** Aligns text to the left. */\n FontAlign[\"LEFT\"] = \"left\";\n /** Aligns text to the right. */\n FontAlign[\"RIGHT\"] = \"right\";\n})(FontAlign || (FontAlign = {}));\n/**\n * Enumerates all available font size presets.\n * These correspond to specific pixel values calculated at runtime based on screen size.\n */\nexport var FontSize;\n(function (FontSize) {\n FontSize[FontSize[\"EXTRA_SMALL\"] = 0] = \"EXTRA_SMALL\";\n FontSize[FontSize[\"SMALL\"] = 1] = \"SMALL\";\n FontSize[FontSize[\"MEDIUM\"] = 2] = \"MEDIUM\";\n FontSize[FontSize[\"LARGE\"] = 3] = \"LARGE\";\n FontSize[FontSize[\"EXTRA_LARGE\"] = 4] = \"EXTRA_LARGE\";\n})(FontSize || (FontSize = {}));\n/**\n * Enumerates all available vertical text alignments.\n */\nexport var FontVerticalAlign;\n(function (FontVerticalAlign) {\n /** Aligns text to the vertical center. */\n FontVerticalAlign[\"CENTER\"] = \"center\";\n /** Aligns text to the top. */\n FontVerticalAlign[\"TOP\"] = \"top\";\n /** Aligns text to the bottom. */\n FontVerticalAlign[\"BOTTOM\"] = \"bottom\";\n})(FontVerticalAlign || (FontVerticalAlign = {}));\n/**\n * Enumerates all available sound assets.\n * Each value corresponds to the path of the audio file.\n */\nexport var Sound;\n(function (Sound) {\n Sound[\"SPAWN\"] = \"./sounds/sound_01.wav\";\n Sound[\"SCORE_1\"] = \"./sounds/sound_15.wav\";\n Sound[\"SCORE_2\"] = \"./sounds/sound_03.wav\";\n Sound[\"SCORE_3\"] = \"./sounds/sound_02.wav\";\n Sound[\"KEY_PRESS\"] = \"./sounds/sound_14.wav\";\n Sound[\"ACTION_1\"] = \"./sounds/sound_05.wav\";\n Sound[\"ACTION_2\"] = \"./sounds/sound_13.wav\";\n Sound[\"HIT_1\"] = \"./sounds/sound_06.wav\";\n Sound[\"HIT_2\"] = \"./sounds/sound_08.wav\";\n Sound[\"DODGE\"] = \"./sounds/sound_07.wav\";\n Sound[\"DROP\"] = \"./sounds/sound_11.wav\";\n Sound[\"EXPLOSION\"] = \"./sounds/sound_09.wav\";\n Sound[\"GAME_START\"] = \"./sounds/sound_04.wav\";\n Sound[\"SHOT\"] = \"./sounds/sound_12.wav\";\n Sound[\"START_THEME\"] = \"./sounds/sound_10.wav\";\n})(Sound || (Sound = {}));\n/**\n * Enumerates all logical control keys used in the engine.\n * These are mapped to physical keys in the Control module.\n */\nexport var ControlKey;\n(function (ControlKey) {\n ControlKey[\"UP\"] = \"up;control\";\n ControlKey[\"DOWN\"] = \"down;control\";\n ControlKey[\"LEFT\"] = \"left;control\";\n ControlKey[\"RIGHT\"] = \"right;control\";\n ControlKey[\"ACTION\"] = \"action;control\";\n ControlKey[\"POWER\"] = \"power;system\";\n ControlKey[\"START_PAUSE\"] = \"start_pause;system\";\n ControlKey[\"SOUND\"] = \"sound;system\";\n ControlKey[\"RESET\"] = \"reset;system\";\n ControlKey[\"EXIT\"] = \"exit;system\";\n ControlKey[\"COLOR\"] = \"color;system\";\n})(ControlKey || (ControlKey = {}));\n/**\n * Enumerates the types of input events.\n */\nexport var ControlEventType;\n(function (ControlEventType) {\n /** Triggered once when the key is pressed down. */\n ControlEventType[\"PRESSED\"] = \"pressed\";\n /** Triggered continuously while the key is held down. */\n ControlEventType[\"HELD\"] = \"held\";\n})(ControlEventType || (ControlEventType = {}));\n/**\n * Enumerates all observable state properties.\n * These keys are used for state subscriptions and persistence.\n */\nexport var StateProperty;\n(function (StateProperty) {\n StateProperty[\"ON\"] = \"on\";\n StateProperty[\"START\"] = \"start\";\n StateProperty[\"PLAYING\"] = \"playing\";\n StateProperty[\"GAME_OVER\"] = \"gameOver\";\n StateProperty[\"COLOR_ENABLED\"] = \"colorEnabled\";\n StateProperty[\"MUTED\"] = \"muted\";\n})(StateProperty || (StateProperty = {}));\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export default {\n /** Colors used for styling the game interface. */\n colors: {\n /** Primary background color for the game screen. */\n background: 'rgb(172, 189, 173)',\n /** Active Font/Cell color. */\n active: 'rgb(19, 26, 18)',\n /** Inactive Font/Cell color. */\n inactive: 'rgba(161, 178, 160, 1)',\n /** Main theme color for the game device body. */\n bodyMain: 'rgb(0, 68, 187)',\n /** Secondary theme color for the buttons on the device body. */\n bodyButton: 'rgb(247, 222, 57)',\n },\n /** Screen layout configurations. */\n screenLayout: {\n /** Main game grid dimensions. */\n grid: {\n columns: 11,\n rows: 18,\n },\n /** Head-Up Display (HUD) grid dimensions. */\n hudGrid: {\n columns: 4,\n rows: 4,\n },\n /** Logical display settings within the container. */\n display: {\n width: 0.65,\n height: 0.956,\n margin: 0.022,\n borderWeight: 0.0075,\n },\n /** Predefined font scale factors relative to container size. */\n fontSize: {\n extraSmall: 0.05,\n small: 0.065,\n medium: 0.1,\n large: 0.125,\n extraLarge: 0.15,\n },\n /** Sizing and spacing for individual grid cells. */\n cell: {\n margin: 0.1,\n padding: 0.3,\n strokeWeight: 0.075,\n },\n },\n /** View layout configurations. */\n viewLayout: {\n /** Aspect ratio multiplier for the device body height relative to width. */\n bodyHeightWidthMultiplier: 1.9,\n /** Screen width threshold for switching to mobile layout (in pixels). */\n mobileBreakpoint: 600,\n /** Responsive canvas scaling and aspect ratio settings. */\n canvas: {\n widthRatio: 0.7,\n aspectRatio: 1.114, // Height relative to width\n },\n /** Delay before hiding the splash screen after initialization (in milliseconds). */\n splashHideDelayMs: 250,\n /** Dimensions and ratios for the game interface. */\n dimensions: {\n /** Border radius as a ratio of container width. */\n borderRadiusRatio: 0.05,\n /** Border width as a ratio of container width. */\n borderWidthRatio: 0.006,\n /** Button-specific scaling factors. */\n button: {\n /** Small button size ratio. */\n smSizeRatio: 0.08,\n /** Medium/Standard button size ratio. */\n mdSizeRatio: 0.18,\n /** Large action button size ratio. */\n lgSizeRatio: 0.25,\n /** Scaling factors specifically for mobile viewports. */\n mobile: {\n /** Mobile small button size ratio. */\n smSizeRatio: 0.13,\n /** Mobile medium/standard button size ratio. */\n mdSizeRatio: 0.26,\n /** Mobile large action button size ratio. */\n lgSizeRatio: 0.35,\n /** Standard font ratio for mobile buttons. */\n fontRatio: 0.05,\n /** Small font ratio for mobile buttons. */\n smFontRatio: 0.04,\n /** Large font ratio for mobile buttons. */\n lgFontRatio: 0.055,\n /** Spacing ratio between mobile buttons. */\n spacingRatio: 0.018,\n },\n /** Button border width as a ratio of container width. */\n borderRatio: 0.0045,\n /** Duration for button press animations. */\n animationDuration: '0.15s',\n },\n },\n /** Standard shadow dispersion size for UI depth. */\n shadowDispersion: '3px',\n },\n /** Input query parameters. */\n inputQueryParams: {\n /** Key for customizing the device body main color. */\n mainColor: 'body-color',\n /** Key for customizing the device body button color. */\n buttonColor: 'button-color',\n /** Key for detecting if the game is running on a mobile app wrapper. */\n runningOnApp: 'mobile',\n },\n /** Selectors for DOM elements. */\n selectors: {\n /** Root container where the p5 instance is attached. */\n parent: '#brick-game',\n /** Splash screen shown during initial load. */\n splash: '#splash',\n /** Modal IDs used for session continuation. */\n modalIds: {\n /** Modal shown when continuing a previous session. */\n sessionModal: '#session-modal',\n /** Confirmation button in the session modal. */\n sessionContinueYes: '#session-modal-yes',\n /** Cancellation button in the session modal. */\n sessionContinueNo: '#session-modal-no',\n },\n /** Explicit IDs assigned to dynamically created DOM elements. */\n viewElementIds: {\n canvas: 'brick-game-canvas',\n container: 'container',\n frame: 'frame',\n buttonContainer: 'button-container',\n smallButtonContainer: 'small-button-container',\n innerButtonContainer: 'inner-button-container',\n mediumButtonContainer: 'medium-button-container',\n directionVerticalContainer: 'direction-vertical-container',\n directionHorizontalContainer: 'direction-horizontal-container',\n largeButtonContainer: 'large-button-container',\n },\n },\n /** Storage keys for persisting data in LocalStorage. */\n storageKeys: {\n /** Key for audio muting preference. */\n muted: 'STATE.MUTED',\n /** Key for color mode preference. */\n colorEnabled: 'STATE.COLOR_ENABLED',\n /** Key for the current game grid state. */\n grid: 'GAME.GRID',\n /** Key for the current HUD grid state. */\n hudGrid: 'GAME.HUD_GRID',\n /** Key for the game speed/tick interval. */\n tickInterval: 'GAME.TICK_INTERVAL',\n /** Key for the user's high score. */\n score: 'GAME.SCORE',\n },\n /** Button hold settings. */\n buttonHold: {\n /** Initial delay before a held button starts repeating (in milliseconds). */\n holdDelayMs: 250,\n /** Interval between repeated actions while a button is held (in milliseconds). */\n holdIntervalMs: 50,\n },\n /** Game settings. */\n game: {\n /** Interval between game ticks (in milliseconds). */\n tickInterval: 1000 / 30, // 30 ticks per second\n /** Minimum interval between game ticks (in milliseconds). */\n minTickInterval: 1000 / 60, // 60 ticks per second\n /** Performance Monitor settings. */\n debugger: {\n /** Number of milliseconds to count before updating the performance. */\n msInterval: 100,\n /** Enable performance overlay. */\n enabled: true,\n },\n sound: {\n volume: 0.025,\n },\n },\n};\n","import { ControlEventType } from '../types/Types';\nimport configs from '../../config/configs';\n/**\n * Helper class that standardizes input handling logic.\n * It manages the distinction between single 'press' events and continuous 'hold' events\n * for both keyboard and UI button inputs.\n */\nvar ControlInputHandlerHelper = /** @class */ (function () {\n /**\n * Creates an instance of the input handler.\n *\n * @param {Control} control - The control module instance to notify.\n */\n function ControlInputHandlerHelper(control) {\n this._activeKeys = new Map();\n this._control = control;\n }\n /**\n * Processes a key down or button press action.\n * Triggers an immediate {@link ControlEventType.PRESSED} event, and schedules\n * a {@link ControlEventType.HELD} loop if the key remains active.\n *\n * @param {ControlKey} key - The identity of the control key being pressed.\n */\n ControlInputHandlerHelper.prototype.handlePress = function (key) {\n var _this = this;\n if (this._activeKeys.has(key))\n return; // Prevent double handling\n // 1. Notify Pressed\n this._control.notify(key, ControlEventType.PRESSED);\n // 2. Schedule Hold\n var delayTimer = setTimeout(function () {\n var holdTimer = setInterval(function () {\n _this._control.notify(key, ControlEventType.HELD);\n }, configs.buttonHold.holdIntervalMs);\n // Update map with hold timer\n var timers = _this._activeKeys.get(key);\n if (timers) {\n timers.hold = holdTimer;\n }\n }, configs.buttonHold.holdDelayMs);\n this._activeKeys.set(key, { delay: delayTimer, hold: null });\n };\n /**\n * Processes a key up or button release action.\n * Cancels any pending hold timers and cleans up the active key state.\n *\n * @param {ControlKey} key - The identity of the control key being released.\n */\n ControlInputHandlerHelper.prototype.handleRelease = function (key) {\n var timers = this._activeKeys.get(key);\n if (timers) {\n clearTimeout(timers.delay);\n if (timers.hold) {\n clearInterval(timers.hold);\n }\n this._activeKeys.delete(key);\n }\n };\n return ControlInputHandlerHelper;\n}());\nexport default ControlInputHandlerHelper;\n","import { ControlKey } from '../../types/enums';\nimport ControlInputHandler from '../../helpers/ControlInputHandlerHelper';\nvar DEFAULT_KEY_MAP = {\n // Arrows\n ArrowUp: ControlKey.UP,\n ArrowDown: ControlKey.DOWN,\n ArrowLeft: ControlKey.LEFT,\n ArrowRight: ControlKey.RIGHT,\n // WASD\n KeyW: ControlKey.UP,\n KeyS: ControlKey.DOWN,\n KeyA: ControlKey.LEFT,\n KeyD: ControlKey.RIGHT,\n // Actions\n KeyJ: ControlKey.ACTION,\n // System\n Digit1: ControlKey.POWER,\n Digit2: ControlKey.START_PAUSE,\n Digit3: ControlKey.SOUND,\n Digit4: ControlKey.RESET,\n Digit5: ControlKey.EXIT,\n Digit6: ControlKey.COLOR,\n};\n/**\n * Handles the binding of physical keyboard events to logical control actions.\n * Translates Browser `KeyboardEvent`s into engine `ControlKey`s.\n */\nvar GameControlKeyBinding = /** @class */ (function () {\n /**\n * Creates an instance of GameControlKeyBinding.\n *\n * @param {Control} control - The parent control module.\n */\n function GameControlKeyBinding(control) {\n this._inputHandler = new ControlInputHandler(control);\n this._boundHandleKeyDown = this._handleKeyDown.bind(this);\n this._boundHandleKeyUp = this._handleKeyUp.bind(this);\n }\n /**\n * Binds keyboard events to the global window object.\n */\n GameControlKeyBinding.prototype.bindControls = function () {\n window.addEventListener('keydown', this._boundHandleKeyDown);\n window.addEventListener('keyup', this._boundHandleKeyUp);\n };\n /**\n * Unbinds keyboard events from the global window object.\n */\n GameControlKeyBinding.prototype.unbindControls = function () {\n window.removeEventListener('keydown', this._boundHandleKeyDown);\n window.removeEventListener('keyup', this._boundHandleKeyUp);\n };\n /**\n * Internal handler for key down events.\n *\n * @param {KeyboardEvent} event - The browser keyboard event.\n */\n GameControlKeyBinding.prototype._handleKeyDown = function (event) {\n var controlKey = DEFAULT_KEY_MAP[event.code];\n if (!controlKey)\n return;\n if (event.repeat)\n return; // Ignore native repeat, fully delegating repeat logic to InputHandler\n this._inputHandler.handlePress(controlKey);\n };\n /**\n * Internal handler for key up events.\n *\n * @param {KeyboardEvent} event - The browser keyboard event.\n */\n GameControlKeyBinding.prototype._handleKeyUp = function (event) {\n var controlKey = DEFAULT_KEY_MAP[event.code];\n if (!controlKey)\n return;\n this._inputHandler.handleRelease(controlKey);\n };\n return GameControlKeyBinding;\n}());\nexport default GameControlKeyBinding;\n","import { ControlKey } from '../../types/enums';\nimport GameControlKeyBinding from './GameControlKeyBinding';\n/**\n * Manages game control inputs and event dispatching.\n * Acts as the central hub for handling user input and notifying subscribers.\n */\nvar GameControl = /** @class */ (function () {\n function GameControl() {\n this._subscribers = new Map();\n }\n /**\n * Initializes the control system.\n * Sets up key bindings and prepares the input handler.\n */\n GameControl.prototype.setup = function () {\n this._keyBinding = new GameControlKeyBinding(this);\n this._keyBinding.bindControls();\n };\n /**\n * Unbinds all control event listeners.\n */\n GameControl.prototype.unbindControls = function () {\n this._keyBinding.unbindControls();\n this._subscribers.clear();\n };\n /**\n * Binds all control event listeners.\n */\n GameControl.prototype.bindControls = function () {\n this._keyBinding.bindControls();\n };\n /**\n * Injects the game modules for context-aware events.\n *\n * @param {GameModules} modules - The collected game modules.\n */\n GameControl.prototype.setModules = function (modules) {\n this._modules = modules;\n };\n /**\n * Subscribes a callback to a specific control event.\n *\n * @param {ControlKey} key - The key to listen for.\n * @param {ControlEventType} type - The event type (pressed/held).\n * @param {ControlCallback} callback - The function to execute.\n */\n GameControl.prototype.subscribe = function (key, type, callback) {\n if (!this._subscribers.has(key)) {\n this._subscribers.set(key, new Map());\n }\n var keySubscribers = this._subscribers.get(key);\n if (!keySubscribers.has(type)) {\n keySubscribers.set(type, new Set());\n }\n keySubscribers.get(type).add(callback);\n };\n /**\n * Unsubscribes a callback from a control event.\n *\n * @param {ControlKey} key - The key to stop listening for.\n * @param {ControlEventType} type - The event type.\n * @param {ControlCallback} callback - The function to remove.\n */\n GameControl.prototype.unsubscribe = function (key, type, callback) {\n var keySubscribers = this._subscribers.get(key);\n if (keySubscribers) {\n var callbacks = keySubscribers.get(type);\n if (callbacks) {\n callbacks.delete(callback);\n }\n }\n };\n /**\n * Notifies subscribers of a control event.\n *\n * @param {ControlKey} key - The key triggering the event.\n * @param {ControlEventType} type - The type of event.\n * @throws {Error} If modules have not been initialized.\n */\n GameControl.prototype.notify = function (key, type) {\n var _a;\n if (!this._modules) {\n throw new Error('Modules not initialized');\n }\n var event = {\n key: key,\n type: type,\n modules: this._modules,\n };\n var state = this._modules.state;\n var isAllowed = false;\n if (state.isOff()) {\n isAllowed = key === ControlKey.POWER;\n }\n else if (!state.isStarted() || state.isPlaying() || state.isGameOver()) {\n isAllowed = true;\n }\n else if (state.isPaused()) {\n isAllowed = key.endsWith(';system');\n }\n var callbacks = (_a = this._subscribers.get(key)) === null || _a === void 0 ? void 0 : _a.get(type);\n if (callbacks && isAllowed) {\n callbacks.forEach(function (callback) { return callback(event); });\n }\n };\n /**\n * Retrieves debug information about the control system.\n *\n * @returns {Record<string, string | number | boolean>} The debug data.\n */\n GameControl.prototype.getDebugData = function () {\n var totalSubscribers = 0;\n this._subscribers.forEach(function (keyMap) {\n keyMap.forEach(function (typeSet) {\n totalSubscribers += typeSet.size;\n });\n });\n return {\n total_subscribers: totalSubscribers,\n tracked_keys: this._subscribers.size,\n };\n };\n return GameControl;\n}());\nexport default GameControl;\n","import { Color } from '../types/enums';\n/**\n * Utility class for creating and managing grid cells.\n */\nvar CellHelper = /** @class */ (function () {\n function CellHelper() {\n }\n /**\n * Creates a new empty cell at the specified coordinate.\n *\n * @param {Coordinate} coordinate - The location of the new cell.\n * @returns {Cell} A new cell object initialized with value 0 and default color.\n */\n CellHelper.emptyCell = function (coordinate) {\n return {\n value: 0,\n color: Color.DEFAULT,\n coordinate: coordinate,\n };\n };\n return CellHelper;\n}());\nexport default CellHelper;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n/**\n * Handles movement and projection logic for the game grid.\n */\nvar GridMovementEngine = /** @class */ (function () {\n function GridMovementEngine(grid) {\n this.grid = grid;\n }\n /**\n * Attempts to shift a collection of cells (a piece) in a given direction.\n */\n GridMovementEngine.prototype.movePiece = function (piece, direction) {\n var _this = this;\n var newPiece = piece.map(function (cell) { return (__assign(__assign({}, cell), { coordinate: {\n x: cell.coordinate.x + (direction.x || 0),\n y: cell.coordinate.y + (direction.y || 0),\n } })); });\n var isPartofSelf = function (coord) { return piece.some(function (c) { return c.coordinate.x === coord.x && c.coordinate.y === coord.y; }); };\n var isInvalid = newPiece.some(function (cell) {\n if (!_this.grid.isValidCoordinate(cell.coordinate))\n return true;\n return _this.grid.isCellActive(cell.coordinate) && !isPartofSelf(cell.coordinate);\n });\n return isInvalid ? null : newPiece;\n };\n GridMovementEngine.prototype.movePieceLeft = function (piece) {\n return this.movePiece(piece, { x: -1, y: 0 });\n };\n GridMovementEngine.prototype.movePieceRight = function (piece) {\n return this.movePiece(piece, { x: 1, y: 0 });\n };\n GridMovementEngine.prototype.movePieceUp = function (piece) {\n return this.movePiece(piece, { x: 0, y: -1 });\n };\n GridMovementEngine.prototype.movePieceDown = function (piece) {\n return this.movePiece(piece, { x: 0, y: 1 });\n };\n /**\n * Attempts to shift a single cell in a given direction.\n */\n GridMovementEngine.prototype.moveCell = function (cell, direction) {\n var newCoord = {\n x: cell.coordinate.x + (direction.x || 0),\n y: cell.coordinate.y + (direction.y || 0),\n };\n if (!this.grid.isValidCoordinate(newCoord) || this.grid.isCellActive(newCoord)) {\n return null;\n }\n return __assign(__assign({}, cell), { coordinate: newCoord });\n };\n GridMovementEngine.prototype.moveCellLeft = function (cell) {\n return this.moveCell(cell, { x: -1, y: 0 });\n };\n GridMovementEngine.prototype.moveCellRight = function (cell) {\n return this.moveCell(cell, { x: 1, y: 0 });\n };\n GridMovementEngine.prototype.moveCellUp = function (cell) {\n return this.moveCell(cell, { x: 0, y: -1 });\n };\n GridMovementEngine.prototype.moveCellDown = function (cell) {\n return this.moveCell(cell, { x: 0, y: 1 });\n };\n GridMovementEngine.prototype.getDropPath = function (piece) {\n var currentPiece = piece;\n var nextPiece = this.movePieceDown(currentPiece);\n while (nextPiece !== null) {\n currentPiece = nextPiece;\n nextPiece = this.movePieceDown(currentPiece);\n }\n return currentPiece;\n };\n GridMovementEngine.prototype.getRisePath = function (piece) {\n var currentPiece = piece;\n var nextPiece = this.movePieceUp(currentPiece);\n while (nextPiece !== null) {\n currentPiece = nextPiece;\n nextPiece = this.movePieceUp(currentPiece);\n }\n return currentPiece;\n };\n GridMovementEngine.prototype.getReachPathLeft = function (piece) {\n var currentPiece = piece;\n var nextPiece = this.movePieceLeft(currentPiece);\n while (nextPiece !== null) {\n currentPiece = nextPiece;\n nextPiece = this.movePieceLeft(currentPiece);\n }\n return currentPiece;\n };\n GridMovementEngine.prototype.getReachPathRight = function (piece) {\n var currentPiece = piece;\n var nextPiece = this.movePieceRight(currentPiece);\n while (nextPiece !== null) {\n currentPiece = nextPiece;\n nextPiece = this.movePieceRight(currentPiece);\n }\n return currentPiece;\n };\n return GridMovementEngine;\n}());\nexport default GridMovementEngine;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n/**\n * Handles geometric transformations for pieces on the grid.\n */\nvar GridTransformEngine = /** @class */ (function () {\n function GridTransformEngine(grid) {\n this.grid = grid;\n }\n /**\n * Attempts to rotate a piece 90 degrees around a specific origin.\n */\n GridTransformEngine.prototype.rotatePiece = function (piece, origin, clockwise) {\n var _this = this;\n if (clockwise === void 0) { clockwise = true; }\n var newPiece = piece.map(function (cell) {\n var relX = cell.coordinate.x - origin.x;\n var relY = cell.coordinate.y - origin.y;\n var newRelX = clockwise ? -relY : relY;\n var newRelY = clockwise ? relX : -relX;\n return __assign(__assign({}, cell), { coordinate: {\n x: origin.x + newRelX,\n y: origin.y + newRelY,\n } });\n });\n var isPartofSelf = function (coord) { return piece.some(function (c) { return c.coordinate.x === coord.x && c.coordinate.y === coord.y; }); };\n var isInvalid = newPiece.some(function (cell) {\n if (!_this.grid.isValidCoordinate(cell.coordinate))\n return true;\n return _this.grid.isCellActive(cell.coordinate) && !isPartofSelf(cell.coordinate);\n });\n return isInvalid ? null : newPiece;\n };\n /**\n * Mirrors a piece across a specific axis relative to its bounding box.\n */\n GridTransformEngine.prototype.mirrorPiece = function (piece, axis) {\n if (piece.length === 0)\n return [];\n var bounds = this.getPieceBounds(piece);\n var center = axis === 'x' ? (bounds.min.x + bounds.max.x) / 2 : (bounds.min.y + bounds.max.y) / 2;\n return piece.map(function (cell) { return (__assign(__assign({}, cell), { coordinate: {\n x: axis === 'x' ? Math.round(2 * center - cell.coordinate.x) : cell.coordinate.x,\n y: axis === 'y' ? Math.round(2 * center - cell.coordinate.y) : cell.coordinate.y,\n } })); });\n };\n /**\n * Calculates the bounding box of a piece.\n */\n GridTransformEngine.prototype.getPieceBounds = function (piece) {\n var xs = piece.map(function (c) { return c.coordinate.x; });\n var ys = piece.map(function (c) { return c.coordinate.y; });\n return {\n min: { x: Math.min.apply(Math, xs), y: Math.min.apply(Math, ys) },\n max: { x: Math.max.apply(Math, xs), y: Math.max.apply(Math, ys) },\n };\n };\n return GridTransformEngine;\n}());\nexport default GridTransformEngine;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n/**\n * Handles analysis and search operations on the grid.\n */\nvar GridAnalysisEngine = /** @class */ (function () {\n function GridAnalysisEngine(grid) {\n this.grid = grid;\n }\n /**\n * Identifies all rows that are completely filled with active cells.\n */\n GridAnalysisEngine.prototype.getFullRows = function () {\n var fullRows = [];\n for (var y = 0; y < this.grid.height; y++) {\n var isFull = true;\n for (var x = 0; x < this.grid.width; x++) {\n if (!this.grid.isCellActive({ x: x, y: y })) {\n isFull = false;\n break;\n }\n }\n if (isFull)\n fullRows.push(y);\n }\n return fullRows;\n };\n /**\n * Identifies all columns that are completely filled with active cells.\n */\n GridAnalysisEngine.prototype.getFullColumns = function () {\n var fullColumns = [];\n for (var x = 0; x < this.grid.width; x++) {\n var isFull = true;\n for (var y = 0; y < this.grid.height; y++) {\n if (!this.grid.isCellActive({ x: x, y: y })) {\n isFull = false;\n break;\n }\n }\n if (isFull)\n fullColumns.push(x);\n }\n return fullColumns;\n };\n /**\n * Returns the active cells adjacent to a specific coordinate.\n */\n GridAnalysisEngine.prototype.getNeighbors = function (coord, includeDiagonal) {\n var _this = this;\n if (includeDiagonal === void 0) { includeDiagonal = false; }\n var neighbors = [];\n var offsets = [\n { x: -1, y: 0 },\n { x: 1, y: 0 },\n { x: 0, y: -1 },\n { x: 0, y: 1 },\n ];\n if (includeDiagonal) {\n offsets.push({ x: -1, y: -1 }, { x: 1, y: -1 }, { x: -1, y: 1 }, { x: 1, y: 1 });\n }\n offsets.forEach(function (offset) {\n var neighborCoord = { x: coord.x + offset.x, y: coord.y + offset.y };\n if (_this.grid.isValidCoordinate(neighborCoord)) {\n neighbors.push(_this.grid.getCell(neighborCoord));\n }\n });\n return neighbors;\n };\n /**\n * Finds all connected active cells of the same value starting from a specific coordinate.\n */\n GridAnalysisEngine.prototype.findConnectedCells = function (coord) {\n var _this = this;\n if (!this.grid.isCellActive(coord))\n return [];\n var startCell = this.grid.getCell(coord);\n var targetValue = startCell.value;\n var connected = [];\n var visited = new Set();\n var queue = [coord];\n var getCoordKey = function (c) { return \"\".concat(c.x, \",\").concat(c.y); };\n visited.add(getCoordKey(coord));\n while (queue.length > 0) {\n var current = queue.shift();\n var cell = this.grid.getCell(current);\n if (cell.value === targetValue) {\n connected.push(cell);\n var neighbors = [\n { x: current.x - 1, y: current.y },\n { x: current.x + 1, y: current.y },\n { x: current.x, y: current.y - 1 },\n { x: current.x, y: current.y + 1 },\n ];\n neighbors.forEach(function (n) {\n var key = getCoordKey(n);\n if (_this.grid.isValidCoordinate(n) && !visited.has(key) && _this.grid.isCellActive(n)) {\n visited.add(key);\n queue.push(n);\n }\n });\n }\n }\n return connected;\n };\n /**\n * Swaps the values and colors of two cells.\n */\n GridAnalysisEngine.prototype.swapCells = function (a, b) {\n var cellA = __assign({}, this.grid.getCell(a));\n var cellB = __assign({}, this.grid.getCell(b));\n this.grid.stampCell(__assign(__assign({}, cellB), { coordinate: a }));\n this.grid.stampCell(__assign(__assign({}, cellA), { coordinate: b }));\n };\n return GridAnalysisEngine;\n}());\nexport default GridAnalysisEngine;\n","import CellHelper from '../../../helpers/CellHelper';\n/**\n * Handles line-based operations (rows and columns) on the grid.\n */\nvar GridLineEngine = /** @class */ (function () {\n function GridLineEngine(grid) {\n this.grid = grid;\n }\n /**\n * Checks if every cell in a specific row is active.\n */\n GridLineEngine.prototype.isRowFull = function (y) {\n var gridData = this.grid.getGrid();\n if (y < 0 || y >= this.grid.height)\n return false;\n return gridData[y].every(function (cell) { return cell.value > 0; });\n };\n /**\n * Checks if every cell in a specific row is inactive.\n */\n GridLineEngine.prototype.isRowEmpty = function (y) {\n var gridData = this.grid.getGrid();\n if (y < 0 || y >= this.grid.height)\n return true;\n return gridData[y].every(function (cell) { return cell.value === 0; });\n };\n /**\n * Resets all cells in a specific row to their default empty state.\n */\n GridLineEngine.prototype.clearRow = function (y) {\n var gridData = this.grid.getGrid();\n if (y < 0 || y >= this.grid.height)\n return;\n for (var x = 0; x < this.grid.width; x++) {\n gridData[y][x] = CellHelper.emptyCell({ x: x, y: y });\n }\n };\n /**\n * Shifts all rows above a certain index down by one position.\n */\n GridLineEngine.prototype.shiftRowsDown = function (fromY) {\n var gridData = this.grid.getGrid();\n for (var y = fromY; y > 0; y--) {\n for (var x = 0; x < this.grid.width; x++) {\n var prevCell = gridData[y - 1][x];\n gridData[y][x].value = prevCell.value;\n gridData[y][x].color = prevCell.color;\n }\n }\n this.clearRow(0);\n };\n /**\n * Shifts all rows below a certain index up by one position.\n */\n GridLineEngine.prototype.shiftRowsUp = function (fromY) {\n var gridData = this.grid.getGrid();\n for (var y = fromY; y < this.grid.height - 1; y++) {\n for (var x = 0; x < this.grid.width; x++) {\n var nextCell = gridData[y + 1][x];\n gridData[y][x].value = nextCell.value;\n gridData[y][x].color = nextCell.color;\n }\n }\n this.clearRow(this.grid.height - 1);\n };\n /**\n * Scans for full rows, clears them, and shifts remaining rows down.\n */\n GridLineEngine.prototype.clearFullRows = function () {\n var rowsCleared = 0;\n for (var y = this.grid.height - 1; y >= 0; y--) {\n if (this.isRowFull(y)) {\n this.clearRow(y);\n this.shiftRowsDown(y);\n rowsCleared++;\n y++; // Re-check the same row index after shifting\n }\n }\n return rowsCleared;\n };\n /**\n * Checks if every cell in a specific column is active.\n */\n GridLineEngine.prototype.isColumnFull = function (x) {\n var gridData = this.grid.getGrid();\n if (x < 0 || x >= this.grid.width)\n return false;\n for (var y = 0; y < this.grid.height; y++) {\n if (gridData[y][x].value === 0)\n return false;\n }\n return true;\n };\n /**\n * Checks if every cell in a specific column is inactive.\n */\n GridLineEngine.prototype.isColumnEmpty = function (x) {\n var gridData = this.grid.getGrid();\n if (x < 0 || x >= this.grid.width)\n return true;\n for (var y = 0; y < this.grid.height; y++) {\n if (gridData[y][x].value !== 0)\n return false;\n }\n return true;\n };\n /**\n * Resets all cells in a specific column to their default empty state.\n */\n GridLineEngine.prototype.clearColumn = function (x) {\n var gridData = this.grid.getGrid();\n if (x < 0 || x >= this.grid.width)\n return;\n for (var y = 0; y < this.grid.height; y++) {\n gridData[y][x] = CellHelper.emptyCell({ x: x, y: y });\n }\n };\n /**\n * Shifts all columns to the left of a certain index one position to the right.\n */\n GridLineEngine.prototype.shiftColumnsRight = function (fromX) {\n var gridData = this.grid.getGrid();\n for (var x = fromX; x > 0; x--) {\n for (var y = 0; y < this.grid.height; y++) {\n var prevCell = gridData[y][x - 1];\n gridData[y][x].value = prevCell.value;\n gridData[y][x].color = prevCell.color;\n }\n }\n this.clearColumn(0);\n };\n /**\n * Shifts all columns to the right of a certain index one position to the left.\n */\n GridLineEngine.prototype.shiftColumnsLeft = function (fromX) {\n var gridData = this.grid.getGrid();\n for (var x = fromX; x < this.grid.width - 1; x++) {\n for (var y = 0; y < this.grid.height; y++) {\n var nextCell = gridData[y][x + 1];\n gridData[y][x].value = nextCell.value;\n gridData[y][x].color = nextCell.color;\n }\n }\n this.clearColumn(this.grid.width - 1);\n };\n /**\n * Scans for full columns, clears them, and shifts remaining columns right.\n */\n GridLineEngine.prototype.clearFullColumns = function () {\n var columnsCleared = 0;\n for (var x = this.grid.width - 1; x >= 0; x--) {\n if (this.isColumnFull(x)) {\n this.clearColumn(x);\n this.shiftColumnsRight(x);\n columnsCleared++;\n x++; // Re-check the same column index after shifting\n }\n }\n return columnsCleared;\n };\n return GridLineEngine;\n}());\nexport default GridLineEngine;\n","/**\n * Handles region-based operations (areas, stamps, and occupancy) on the grid.\n */\nvar GridRegionEngine = /** @class */ (function () {\n function GridRegionEngine(grid) {\n this.grid = grid;\n }\n /**\n * Checks if any of the provided coordinates are already occupied or out of bounds.\n */\n GridRegionEngine.prototype.isAreaOccupied = function (coordinates) {\n var _this = this;\n return coordinates.some(function (coord) {\n if (!_this.grid.isValidCoordinate(coord))\n return true;\n return _this.grid.isCellActive(coord);\n });\n };\n /**\n * Fills a rectangular region defined by two corners with a specific value and color.\n */\n GridRegionEngine.prototype.fillArea = function (start, end, value, color) {\n var xMin = Math.max(0, Math.min(start.x, end.x));\n var xMax = Math.min(this.grid.width - 1, Math.max(start.x, end.x));\n var yMin = Math.max(0, Math.min(start.y, end.y));\n var yMax = Math.min(this.grid.height - 1, Math.max(start.y, end.y));\n for (var y = yMin; y <= yMax; y++) {\n for (var x = xMin; x <= xMax; x++) {\n this.grid.setCellValue({ x: x, y: y }, value);\n this.grid.setCellColor({ x: x, y: y }, color);\n }\n }\n };\n /**\n * Updates multiple coordinates simultaneously with their specific values and colors.\n */\n GridRegionEngine.prototype.stampPiece = function (piece) {\n var _this = this;\n piece.forEach(function (cell) { return _this.grid.stampCell(cell); });\n };\n /**\n * Updates a single coordinate with a specific value and color from a Cell.\n */\n GridRegionEngine.prototype.stampCell = function (cell) {\n this.grid.setCellValue(cell.coordinate, cell.value);\n this.grid.setCellColor(cell.coordinate, cell.color);\n };\n return GridRegionEngine;\n}());\nexport default GridRegionEngine;\n","import configs from '../../../config/configs';\nimport CellHelper from '../../helpers/CellHelper';\nimport GridMovementEngine from './engines/GridMovementEngine';\nimport GridTransformEngine from './engines/GridTransformEngine';\nimport GridAnalysisEngine from './engines/GridAnalysisEngine';\nimport GridLineEngine from './engines/GridLineEngine';\nimport GridRegionEngine from './engines/GridRegionEngine';\n/**\n * Manages the game's logical grid state and operations.\n *\n * Provides a robust API for cell manipulation, row/column management,\n * collision detection, and mass grid modifications.\n */\nvar GameGrid = /** @class */ (function () {\n function GameGrid() {\n /**\n * The internal 2D array representing the game grid [y][x].\n */\n this._grid = [];\n this.serialId = 'grid';\n this._movementEngine = new GridMovementEngine(this);\n this._transformEngine = new GridTransformEngine(this);\n this._analysisEngine = new GridAnalysisEngine(this);\n this._lineEngine = new GridLineEngine(this);\n this._regionEngine = new GridRegionEngine(this);\n }\n // --- CORE & UTILITIES ---\n /**\n * Gets the current grid state as a 2D array of cells.\n *\n * @returns {Cell[][]} The underlying grid data.\n */\n GameGrid.prototype.getGrid = function () {\n return this._grid;\n };\n Object.defineProperty(GameGrid.prototype, \"width\", {\n /**\n * Gets the number of columns in the grid.\n *\n * @returns {number} The grid width.\n */\n get: function () {\n return configs.screenLayout.grid.columns;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GameGrid.prototype, \"height\", {\n /**\n * Gets the number of rows in the grid.\n *\n * @returns {number} The grid height.\n */\n get: function () {\n return configs.screenLayout.grid.rows;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Initializes the grid by resetting its content to an empty state.\n *\n * @returns {void}\n */\n GameGrid.prototype.setup = function () {\n this.resetGrid();\n };\n /**\n * Resets the entire grid state based on the dimensions defined in the configuration.\n *\n * Populates the grid with empty cells using {@link CellHelper.emptyCell}.\n *\n * @returns {void}\n */\n GameGrid.prototype.resetGrid = function () {\n this._grid = [];\n for (var y = 0; y < this.height; y++) {\n this._grid[y] = [];\n for (var x = 0; x < this.width; x++) {\n this._grid[y][x] = CellHelper.emptyCell({ x: x, y: y });\n }\n }\n };\n /**\n * Iterates over every cell in the grid and executes a callback.\n *\n * @param {function(Cell): void} callback - The function to execute for each cell.\n * @returns {void}\n */\n GameGrid.prototype.forEach = function (callback) {\n for (var y = 0; y < this.height; y++) {\n for (var x = 0; x < this.width; x++) {\n callback(this._grid[y][x]);\n }\n }\n };\n /**\n * Verifies if a given coordinate is within the grid boundaries.\n *\n * @param {Coordinate} coordinate - The coordinate to validate.\n * @returns {boolean} True if the coordinate is valid, false otherwise.\n */\n GameGrid.prototype.isValidCoordinate = function (coordinate) {\n return coordinate.x >= 0 && coordinate.x < this.width && coordinate.y >= 0 && coordinate.y < this.height;\n };\n /**\n * Retrieves a cell at a specific coordinate.\n *\n * @param {Coordinate} coordinate - The coordinate of the cell.\n * @returns {Cell | null} The cell object, or null if out of bounds.\n */\n GameGrid.prototype.getCell = function (coordinate) {\n if (!this.isValidCoordinate(coordinate)) {\n return null;\n }\n return this._grid[coordinate.y][coordinate.x];\n };\n /**\n * Updates the status value of a cell at a specific coordinate.\n *\n * @param {Coordinate} coordinate - The target coordinate.\n * @param {number} value - The new value (e.g., 0 for inactive, >0 for active).\n * @returns {void}\n */\n GameGrid.prototype.setCellValue = function (coordinate, value) {\n if (!this.isValidCoordinate(coordinate)) {\n return;\n }\n this._grid[coordinate.y][coordinate.x].value = value;\n };\n /**\n * Updates the color of a cell at a specific coordinate.\n *\n * @param {Coordinate} coordinate - The target coordinate.\n * @param {Color} color - The new color enum value.\n * @returns {void}\n */\n GameGrid.prototype.setCellColor = function (coordinate, color) {\n if (!this.isValidCoordinate(coordinate)) {\n return;\n }\n this._grid[coordinate.y][coordinate.x].color = color;\n };\n /**\n * Checks if a cell at a specific coordinate is active (value > 0).\n *\n * @param {Coordinate} coordinate - The coordinate to check.\n * @returns {boolean} True if active, false otherwise.\n */\n GameGrid.prototype.isCellActive = function (coordinate) {\n var cell = this.getCell(coordinate);\n return cell !== null && cell.value > 0;\n };\n /**\n * Checks if a cell at a specific coordinate is inactive (value === 0).\n *\n * @param {Coordinate} coordinate - The coordinate to check.\n * @returns {boolean} True if inactive, false otherwise.\n */\n GameGrid.prototype.isCellInactive = function (coordinate) {\n var cell = this.getCell(coordinate);\n return cell !== null && cell.value === 0;\n };\n // --- ROW OPERATIONS ---\n /**\n * Checks if every cell in a specific row is active.\n *\n * @param {number} y - The row index.\n * @returns {boolean} True if the row is completely full.\n */\n GameGrid.prototype.isRowFull = function (y) {\n return this._lineEngine.isRowFull(y);\n };\n /**\n * Checks if every cell in a specific row is inactive.\n *\n * @param {number} y - The row index.\n * @returns {boolean} True if the row is completely empty.\n */\n GameGrid.prototype.isRowEmpty = function (y) {\n return this._lineEngine.isRowEmpty(y);\n };\n /**\n * Resets all cells in a specific row to their default empty state.\n *\n * @param {number} y - The row index to clear.\n * @returns {void}\n */\n GameGrid.prototype.clearRow = function (y) {\n this._lineEngine.clearRow(y);\n };\n /**\n * Shifts all rows above a certain index down by one position.\n *\n * Clears the top-most row after shifting.\n *\n * @param {number} fromY - The starting row index for the shift down.\n * @returns {void}\n */\n GameGrid.prototype.shiftRowsDown = function (fromY) {\n this._lineEngine.shiftRowsDown(fromY);\n };\n /**\n * Shifts all rows below a certain index up by one position.\n *\n * Clears the bottom-most row after shifting.\n *\n * @param {number} fromY - The starting row index for the shift up.\n * @returns {void}\n */\n GameGrid.prototype.shiftRowsUp = function (fromY) {\n this._lineEngine.shiftRowsUp(fromY);\n };\n /**\n * Scans the grid for full rows, clears them, and shifts remaining rows down.\n *\n * Re-checks the same index after a shift to handle consecutive full rows.\n *\n * @returns {number} The total number of rows cleared during the operation.\n */\n GameGrid.prototype.clearFullRows = function () {\n return this._lineEngine.clearFullRows();\n };\n // --- COLUMN OPERATIONS ---\n /**\n * Checks if every cell in a specific column is active.\n *\n * @param {number} x - The column index.\n * @returns {boolean} True if the column is completely full.\n */\n GameGrid.prototype.isColumnFull = function (x) {\n return this._lineEngine.isColumnFull(x);\n };\n /**\n * Checks if every cell in a specific column is inactive.\n *\n * @param {number} x - The column index.\n * @returns {boolean} True if the column is completely empty.\n */\n GameGrid.prototype.isColumnEmpty = function (x) {\n return this._lineEngine.isColumnEmpty(x);\n };\n /**\n * Resets all cells in a specific column to their default empty state.\n *\n * @param {number} x - The column index to clear.\n * @returns {void}\n */\n GameGrid.prototype.clearColumn = function (x) {\n this._lineEngine.clearColumn(x);\n };\n /**\n * Shifts all columns to the left of a certain index one position to the right.\n *\n * Clears the left-most column (index 0) after shifting.\n *\n * @param {number} fromX - The starting column index for the shift right.\n * @returns {void}\n */\n GameGrid.prototype.shiftColumnsRight = function (fromX) {\n this._lineEngine.shiftColumnsRight(fromX);\n };\n /**\n * Shifts all columns to the right of a certain index one position to the left.\n *\n * Clears the right-most column after shifting.\n *\n * @param {number} fromX - The starting column index for the shift left.\n * @returns {void}\n */\n GameGrid.prototype.shiftColumnsLeft = function (fromX) {\n this._lineEngine.shiftColumnsLeft(fromX);\n };\n /**\n * Scans the grid for full columns, clears them, and shifts remaining columns right.\n *\n * @returns {number} The total number of columns cleared during the operation.\n */\n GameGrid.prototype.clearFullColumns = function () {\n return this._lineEngine.clearFullColumns();\n };\n // --- ADVANCED OPERATIONS ---\n /**\n * Checks if any of the provided coordinates are already occupied (active) or out of bounds.\n *\n * @param {Coordinate[]} coordinates - An array of coordinates to check.\n * @returns {boolean} True if the area is occupied or invalid, false if completely clear.\n */\n GameGrid.prototype.isAreaOccupied = function (coordinates) {\n return this._regionEngine.isAreaOccupied(coordinates);\n };\n /**\n * Fills a rectangular region defined by two corners with a specific value and color.\n *\n * Automatically handles bounds and coordinate order.\n *\n * @param {Coordinate} start - One corner of the rectangle.\n * @param {Coordinate} end - The opposite corner of the rectangle.\n * @param {number} value - The cell status value to apply.\n * @param {Color} color - The color to apply.\n * @returns {void}\n */\n GameGrid.prototype.fillArea = function (start, end, value, color) {\n this._regionEngine.fillArea(start, end, value, color);\n };\n /**\n * Updates multiple coordinates simultaneously with their specific values and colors.\n *\n * Effectively \"stamps\" a piece's shape onto the static grid.\n *\n * @param {Piece} piece - The collection of cells to stamp.\n * @returns {void}\n */\n GameGrid.prototype.stampPiece = function (piece) {\n this._regionEngine.stampPiece(piece);\n };\n /**\n * Updates a single coordinate with a specific value and color from a Cell.\n *\n * @param {Cell} cell - The cell containing coordinate, value and color.\n * @returns {void}\n */\n GameGrid.prototype.stampCell = function (cell) {\n this._regionEngine.stampCell(cell);\n };\n /**\n * Attempts to shift a collection of cells (a piece) in a given direction.\n *\n * Validates that all new positions are within grid boundaries and are not\n * occupied by other active cells (excluding the cells that are part of the original piece).\n *\n * @param {Piece} piece - The current piece (collection of cells).\n * @param {Vector} direction - The movement vector (e.g., {x: -1, y: 0} for left).\n * @returns {Piece | null} The new piece with updated coordinates if the move is valid, or null if blocked.\n */\n GameGrid.prototype.movePiece = function (piece, direction) {\n return this._movementEngine.movePiece(piece, direction);\n };\n /**\n * Alias for {@link movePiece} shifting one unit to the left.\n * @param {Piece} piece - The current piece.\n * @returns {Piece | null}\n */\n GameGrid.prototype.movePieceLeft = function (piece) {\n return this._movementEngine.movePieceLeft(piece);\n };\n /**\n * Alias for {@link movePiece} shifting one unit to the right.\n * @param {Piece} piece - The current piece.\n * @returns {Piece | null}\n */\n GameGrid.prototype.movePieceRight = function (piece) {\n return this._movementEngine.movePieceRight(piece);\n };\n /**\n * Alias for {@link movePiece} shifting one unit up.\n * @param {Piece} piece - The current piece.\n * @returns {Piece | null}\n */\n GameGrid.prototype.movePieceUp = function (piece) {\n return this._movementEngine.movePieceUp(piece);\n };\n /**\n * Alias for {@link movePiece} shifting one unit down.\n * @param {Piece} piece - The current piece.\n * @returns {Piece | null}\n */\n GameGrid.prototype.movePieceDown = function (piece) {\n return this._movementEngine.movePieceDown(piece);\n };\n /**\n * Attempts to shift a single cell in a given direction.\n *\n * Validates that the new position is within grid boundaries and is not occupied.\n *\n * @param {Cell} cell - The current cell.\n * @param {Vector} direction - The movement vector.\n * @returns {Cell | null} The new cell with updated coordinate if the move is valid, or null if blocked.\n */\n GameGrid.prototype.moveCell = function (cell, direction) {\n return this._movementEngine.moveCell(cell, direction);\n };\n /**\n * Alias for {@link moveCell} shifting one unit to the left.\n * @param {Cell} cell - The current cell.\n * @returns {Cell | null}\n */\n GameGrid.prototype.moveCellLeft = function (cell) {\n return this._movementEngine.moveCellLeft(cell);\n };\n /**\n * Alias for {@link moveCell} shifting one unit to the right.\n * @param {Cell} cell - The current cell.\n * @returns {Cell | null}\n */\n GameGrid.prototype.moveCellRight = function (cell) {\n return this._movementEngine.moveCellRight(cell);\n };\n /**\n * Alias for {@link moveCell} shifting one unit up.\n * @param {Cell} cell - The current cell.\n * @returns {Cell | null}\n */\n GameGrid.prototype.moveCellUp = function (cell) {\n return this._movementEngine.moveCellUp(cell);\n };\n /**\n * Alias for {@link moveCell} shifting one unit down.\n * @param {Cell} cell - The current cell.\n * @returns {Cell | null}\n */\n GameGrid.prototype.moveCellDown = function (cell) {\n return this._movementEngine.moveCellDown(cell);\n };\n /**\n * Attempts to rotate a piece 90 degrees around a specific origin.\n *\n * @param {Piece} piece - The current piece.\n * @param {Coordinate} origin - The center of rotation.\n * @param {boolean} [clockwise=true] - Direction of rotation.\n * @returns {Piece | null} The new piece if rotation is valid, or null if blocked.\n */\n GameGrid.prototype.rotatePiece = function (piece, origin, clockwise) {\n if (clockwise === void 0) { clockwise = true; }\n return this._transformEngine.rotatePiece(piece, origin, clockwise);\n };\n /**\n * Identifies all rows that are completely filled with active cells.\n *\n * @returns {number[]} Array of row indices (y).\n */\n GameGrid.prototype.getFullRows = function () {\n return this._analysisEngine.getFullRows();\n };\n /**\n * Identifies all columns that are completely filled with active cells.\n *\n * @returns {number[]} Array of column indices (x).\n */\n GameGrid.prototype.getFullColumns = function () {\n return this._analysisEngine.getFullColumns();\n };\n /**\n * Calculates the final resting position of a piece if it were dropped continuously.\n *\n * @param {Piece} piece - The piece to project.\n * @returns {Piece} The piece at its final vertical resting position.\n */\n GameGrid.prototype.getDropPath = function (piece) {\n return this._movementEngine.getDropPath(piece);\n };\n /**\n * Calculates the final resting position of a piece if it were moved continuously upwards.\n *\n * @param {Piece} piece - The piece to project.\n * @returns {Piece} The piece at its highest vertical resting position.\n */\n GameGrid.prototype.getRisePath = function (piece) {\n return this._movementEngine.getRisePath(piece);\n };\n /**\n * Calculates the final resting position of a piece if it were moved continuously to the left.\n *\n * @param {Piece} piece - The piece to project.\n * @returns {Piece} The piece at its leftmost resting position.\n */\n GameGrid.prototype.getReachPathLeft = function (piece) {\n return this._movementEngine.getReachPathLeft(piece);\n };\n /**\n * Calculates the final resting position of a piece if it were moved continuously to the right.\n *\n * @param {Piece} piece - The piece to project.\n * @returns {Piece} The piece at its rightmost resting position.\n */\n GameGrid.prototype.getReachPathRight = function (piece) {\n return this._movementEngine.getReachPathRight(piece);\n };\n /**\n * Returns the active cells adjacent to a specific coordinate.\n *\n * @param {Coordinate} coord - The center coordinate.\n * @param {boolean} [includeDiagonal=false] - Whether to include 8 neighbors or just 4.\n * @returns {Cell[]} List of neighboring cells.\n */\n GameGrid.prototype.getNeighbors = function (coord, includeDiagonal) {\n if (includeDiagonal === void 0) { includeDiagonal = false; }\n return this._analysisEngine.getNeighbors(coord, includeDiagonal);\n };\n /**\n * Finds all connected active cells of the same value starting from a specific coordinate.\n * Uses a Breadth-First Search (BFS) algorithm.\n *\n * @param {Coordinate} coord - Starting coordinate.\n * @returns {Piece} Collection of connected cells.\n */\n GameGrid.prototype.findConnectedCells = function (coord) {\n return this._analysisEngine.findConnectedCells(coord);\n };\n /**\n * Mirrors a piece across a specific axis relative to its bounding box.\n *\n * @param {Piece} piece - The piece to mirror.\n * @param {Axis} axis - The axis to flip across ('x' for horizontal flip, 'y' for vertical).\n * @returns {Piece} The mirrored piece.\n */\n GameGrid.prototype.mirrorPiece = function (piece, axis) {\n return this._transformEngine.mirrorPiece(piece, axis);\n };\n /**\n * Swaps the values and colors of two cells.\n *\n * @param {Coordinate} a - First coordinate.\n * @param {Coordinate} b - Second coordinate.\n * @returns {void}\n */\n GameGrid.prototype.swapCells = function (a, b) {\n this._analysisEngine.swapCells(a, b);\n };\n /**\n * Private helper to get piece bounds, delegated to transform engine.\n */\n GameGrid.prototype.getPieceBounds = function (piece) {\n return this._transformEngine.getPieceBounds(piece);\n };\n /**\n * Returns metadata for the real-time debugger.\n *\n * @returns {Record<string, string | number | boolean>} Technical debugging data.\n */\n GameGrid.prototype.getDebugData = function () {\n return {\n width: this.width,\n height: this.height,\n activeCells: this._grid.flat().filter(function (cell) { return cell.value > 0; }).length,\n };\n };\n GameGrid.prototype.serialize = function () {\n console.log('serialize');\n return JSON.stringify({\n grid: this._grid,\n });\n };\n GameGrid.prototype.deserialize = function (data) {\n console.log('deserialize');\n var parsed = JSON.parse(data);\n this._grid = parsed.grid;\n };\n return GameGrid;\n}());\nexport default GameGrid;\n","/**\n * Static utility for calculating pixel values relative to the canvas size.\n * Allows for responsive design by defining sizes as percentages (0.0 - 1.0).\n */\nvar RelativeValuesHelper = /** @class */ (function () {\n function RelativeValuesHelper() {\n }\n /**\n * Calculates a pixel width based on a percentage of the canvas width.\n *\n * @param {p5} p - The P5 instance.\n * @param {number} size - The percentage (0.0 to 1.0).\n * @returns {number} The absolute width in pixels.\n */\n RelativeValuesHelper.getRelativeWidth = function (p, size) {\n return size * p.width;\n };\n /**\n * Calculates a pixel height based on a percentage of the canvas height.\n *\n * @param {p5} p - The P5 instance.\n * @param {number} size - The percentage (0.0 to 1.0).\n * @returns {number} The absolute height in pixels.\n */\n RelativeValuesHelper.getRelativeHeight = function (p, size) {\n return size * p.height;\n };\n return RelativeValuesHelper;\n}());\nexport default RelativeValuesHelper;\n","import configs from '../../../config/configs';\nimport { Color } from '../../types/enums';\nimport RelativeValuesHelper from '../../helpers/RelativeValuesHelper';\n/**\n * Responsible for rendering the main game field (the grid where the game is played).\n * Handles cell rendering, background drawing, and optimizes static elements using an off-screen buffer.\n */\nvar DisplayRenderer = /** @class */ (function () {\n /**\n * Creates an instance of the DisplayRenderer.\n *\n * @param {p5} p - The p5 instance.\n */\n function DisplayRenderer(p) {\n this._p = p;\n }\n /**\n * Initializes the renderer with the calculated metrics.\n * Pre-calculates cell geometry for faster rendering.\n *\n * @param {RendererMetrics} rendererMetrics - The shared renderer metrics.\n */\n DisplayRenderer.prototype.setup = function (rendererMetrics) {\n this._rendererMetrics = rendererMetrics;\n var _a = configs.screenLayout.cell, cellMargin = _a.margin, cellPadding = _a.padding, cellStrokeWeight = _a.strokeWeight;\n // Use pre-calculated cell size\n var cellSize = this._rendererMetrics.cell.size;\n // 3. Pre-calculate localized cell geometry (relative to cell 0,0)\n this._cellPreCalculatedGeometry = {\n innerOffset: cellMargin * cellSize,\n innerSize: cellSize - cellMargin * cellSize * 2,\n paddingOffset: cellPadding * cellSize,\n paddingSize: cellSize - cellPadding * cellSize * 2,\n strokeWeight: cellStrokeWeight * cellSize,\n };\n // Initialize static graphics buffer and render static elements\n this._renderStaticElements();\n };\n /**\n * Renders the game grid.\n * Draws the static background first, then iterates over the grid to draw cells.\n *\n * @param {Cell[][]} grid - The current grid state.\n */\n DisplayRenderer.prototype.render = function (grid, modules) {\n this._p.push();\n this._p.image(this._staticGraphics, 0, 0);\n this.renderGrid(grid, modules.state);\n this._p.pop();\n };\n /**\n * Renders static elements (background and borders) to an off-screen buffer.\n * This improves performance by avoiding re-drawing static shapes every frame.\n */\n DisplayRenderer.prototype._renderStaticElements = function () {\n var borderWeight = configs.screenLayout.display.borderWeight;\n this._staticGraphics = this._p.createGraphics(this._p.width, this._p.height);\n this._staticGraphics.background(configs.colors.background);\n this._staticGraphics.strokeWeight(RelativeValuesHelper.getRelativeWidth(this._p, borderWeight));\n this._staticGraphics.noFill();\n this._staticGraphics.stroke(configs.colors.active);\n this._staticGraphics.rect(this._rendererMetrics.display.origin.x, this._rendererMetrics.display.origin.y, this._rendererMetrics.display.width, this._rendererMetrics.display.height);\n };\n /**\n * Renders a single brick at grid coordinates.\n * Uses translation matrices to keep drawing logic clean.\n *\n * @param {Cell} cell - The cell data to render.\n */\n DisplayRenderer.prototype.renderCell = function (_a, state) {\n var coordinate = _a.coordinate, color = _a.color, value = _a.value;\n var x = coordinate.x, y = coordinate.y;\n var _b = this._cellPreCalculatedGeometry, innerOffset = _b.innerOffset, innerSize = _b.innerSize, paddingOffset = _b.paddingOffset, paddingSize = _b.paddingSize, strokeWeight = _b.strokeWeight;\n if (value === 0 || (!state.isPlaying() && !state.isPaused())) {\n color = Color.INACTIVE;\n }\n else {\n color = state.isColorEnabled() ? color : Color.DEFAULT;\n }\n this._p.push();\n // Move to the specific cell position\n this._p.translate(this._rendererMetrics.display.origin.x + x * this._rendererMetrics.cell.size, this._rendererMetrics.display.origin.y + y * this._rendererMetrics.cell.size);\n this._p.strokeWeight(strokeWeight);\n this._p.stroke(color);\n // Outer Box\n this._p.noFill();\n this._p.rect(innerOffset, innerOffset, innerSize, innerSize);\n // Inner Fill\n this._p.fill(color);\n this._p.rect(paddingOffset, paddingOffset, paddingSize, paddingSize);\n this._p.pop();\n };\n /**\n * Iterates through the grid and renders each cell.\n *\n * @param {Cell[][]} grid - The grid to render.\n */\n DisplayRenderer.prototype.renderGrid = function (grid, state) {\n var _this = this;\n grid.forEach(function (row) {\n row.forEach(function (cell) {\n _this.renderCell(cell, state);\n });\n });\n };\n return DisplayRenderer;\n}());\nexport default DisplayRenderer;\n","import configs from '../../config/configs';\nimport RelativeValuesHelper from './RelativeValuesHelper';\n/**\n * Static utility class for coordinate transformations.\n * Handles conversions between relative (0-1) coordinates and absolute pixel positions\n * for both the main display and the HUD.\n */\nvar CoordinateHelper = /** @class */ (function () {\n function CoordinateHelper() {\n }\n /**\n * Converts a simplified coordinate object to relative screen dimensions.\n *\n * @param {p5} p - The P5 instance.\n * @param {Coordinate} coordinate - The normal coordinate.\n * @returns {Coordinate} A new coordinate scaled to the canvas width/height.\n */\n CoordinateHelper.getRelativeCoordinate = function (p, coordinate) {\n return {\n x: RelativeValuesHelper.getRelativeWidth(p, coordinate.x),\n y: RelativeValuesHelper.getRelativeHeight(p, coordinate.y),\n };\n };\n /**\n * Calculates the absolute X pixel position for an element on the Main Display.\n *\n * @param {p5} p - The p5 instance.\n * @param {number} x - The relative or normalized X position.\n * @param {number} displayWidth - The calculated width of the display area.\n * @returns {number} The absolute X pixel coordinate.\n */\n CoordinateHelper.getDisplayPosX = function (p, x, displayWidth) {\n var margin = configs.screenLayout.display.margin;\n return displayWidth * x + RelativeValuesHelper.getRelativeWidth(p, margin);\n };\n /**\n * Calculates the absolute Y pixel position for an element on the Main Display.\n *\n * @param {p5} p - The p5 instance.\n * @param {number} y - The relative or normalized Y position.\n * @param {number} displayHeight - The calculated height of the display area.\n * @returns {number} The absolute Y pixel coordinate.\n */\n CoordinateHelper.getDisplayPosY = function (p, y, displayHeight) {\n var margin = configs.screenLayout.display.margin;\n return displayHeight * y + RelativeValuesHelper.getRelativeHeight(p, margin);\n };\n /**\n * Calculates the absolute X pixel position for an element on the HUD.\n * Use this to position elements in the sidebar.\n *\n * @param {p5} p - The p5 instance.\n * @param {number} x - The relative or normalized X position within the HUD.\n * @param {number} displayWidth - The width of the main display (used for offset calculation).\n * @returns {number} The absolute X pixel coordinate.\n */\n CoordinateHelper.getHudPosX = function (p, x, displayWidth) {\n var margin = configs.screenLayout.display.margin;\n var zero = displayWidth + RelativeValuesHelper.getRelativeWidth(p, margin) * 2;\n var width = p.width - zero - RelativeValuesHelper.getRelativeWidth(p, margin);\n return width * x + zero;\n };\n /**\n * Calculates the absolute Y pixel position for an element on the HUD.\n *\n * @param {p5} p - The p5 instance.\n * @param {number} y - The relative or normalized Y position within the HUD.\n * @param {number} displayHeight - The height of the main display (used for scaling).\n * @returns {number} The absolute Y pixel coordinate.\n */\n CoordinateHelper.getHudPosY = function (p, y, displayHeight) {\n var margin = configs.screenLayout.display.margin;\n return displayHeight * y + RelativeValuesHelper.getRelativeHeight(p, margin);\n };\n return CoordinateHelper;\n}());\nexport default CoordinateHelper;\n","import { Color, FontAlign, FontSize, FontVerticalAlign } from '../../types/enums';\nimport CoordinateHelper from '../../helpers/CoordinateHelper';\nimport configs from '../../../config/configs';\nimport RelativeValuesHelper from '../../helpers/RelativeValuesHelper';\n/**\n * Responsible for rendering the Heads-Up Display (HUD).\n * Displays game information like Score, High Score, Level, and the Next Piece Preview.\n */\nvar HudRenderer = /** @class */ (function () {\n /**\n * Creates an instance of HudRenderer.\n *\n * @param {p5} p - The p5 instance.\n */\n function HudRenderer(p) {\n this._p = p;\n }\n /**\n * Initializes the HUD with calculated metrics.\n * Sets up the grid origin and border rectangle for the \"next piece\" preview area.\n *\n * @param {RendererMetrics} rendererMetrics - The shared renderer metrics.\n */\n HudRenderer.prototype.setup = function (rendererMetrics) {\n this._cellSize = rendererMetrics.cell.size;\n this._gridOrigin = {\n x: CoordinateHelper.getHudPosX(this._p, 0.078, rendererMetrics.display.width),\n y: CoordinateHelper.getHudPosY(this._p, 0.375, rendererMetrics.display.height),\n };\n this._hudBorderRect = {\n x: this._gridOrigin.x - RelativeValuesHelper.getRelativeWidth(this._p, 0.005),\n y: this._gridOrigin.y - RelativeValuesHelper.getRelativeHeight(this._p, 0.005),\n w: this._cellSize * 4 + RelativeValuesHelper.getRelativeWidth(this._p, 0.01),\n h: this._cellSize * 4 + RelativeValuesHelper.getRelativeHeight(this._p, 0.01),\n };\n };\n /**\n * Renders all HUD elements.\n *\n * @param {Cell[][]} grid - The main game grid (unused in HUD, but required by interface).\n * @param {GameModules} modules - The game modules for retrieving state and score.\n */\n HudRenderer.prototype.render = function (grid, modules) {\n this._renderHud(modules);\n this._drawHudGrid(modules);\n };\n /**\n * Renders the text-based HUD elements (Score, Level, Status).\n *\n * @param {GameModules} modules - The game modules.\n */\n HudRenderer.prototype._renderHud = function (modules) {\n var text = modules.text, state = modules.state, score = modules.score;\n this._p.push();\n text.setTextSize(FontSize.SMALL);\n text.setInactiveText();\n text.setTextAlign(FontAlign.LEFT, FontVerticalAlign.BOTTOM);\n //Placeholders text\n text.textOnHud('88888888', { x: 0.05, y: 0.13 });\n text.textOnHud('88888888', { x: 0.05, y: 0.3 });\n text.textOnHud('88 - 88', { x: 0.05, y: 0.8 });\n if (state.isOn()) {\n text.setActiveText();\n }\n //Score text\n text.textOnHud('Score', { x: 0.05, y: 0.06 });\n text.textOnHud(score.score.toString(), { x: 0.05, y: 0.13 });\n //Hi-Score text\n text.textOnHud('Hi-Score', { x: 0.05, y: 0.23 });\n text.textOnHud(score.highScore.toString(), { x: 0.05, y: 0.3 });\n //Level text\n text.textOnHud('Level', { x: 0.05, y: 0.72 });\n var levelValue = \"\".concat(score.level < 10 ? '0' + score.level : score.level, \" - \").concat(score.maxLevel);\n text.textOnHud(levelValue, { x: 0.05, y: 0.8 });\n text.setTextAlign(FontAlign.CENTER, FontVerticalAlign.BOTTOM);\n //Paused text\n if (state.isPaused()) {\n text.setActiveText();\n }\n else {\n text.setInactiveText();\n }\n text.textOnHud('Paused', { x: 0.5, y: 0.9 });\n //Muted text\n if (state.isOn() && state.isMuted()) {\n text.setActiveText();\n }\n else {\n text.setInactiveText();\n }\n text.textOnHud('Muted', { x: 0.5, y: 0.97 });\n this._p.pop();\n this._drawHudGrid(modules);\n };\n /**\n * Renders the preview grid for the next piece.\n *\n * @param {GameModules} modules - The game modules.\n */\n HudRenderer.prototype._drawHudGrid = function (modules) {\n var _this = this;\n var hudGrid = modules.hudGrid, state = modules.state;\n this._p.push();\n hudGrid.forEach(function (cell) {\n var _a = cell.coordinate, x = _a.x, y = _a.y;\n if (state.isOff() && !state.isPlaying()) {\n cell.value = 0;\n }\n var color = cell.value !== 0 ? Color.DEFAULT : Color.INACTIVE;\n if (state.isColorEnabled() && cell.value !== 0) {\n color = cell.color;\n }\n _this.drawCellElement({\n w: _this._cellSize,\n h: _this._cellSize,\n posX: _this._gridOrigin.x + _this._cellSize * x,\n posY: _this._gridOrigin.y + _this._cellSize * y,\n color: color,\n });\n });\n this._p.noFill();\n this._p.stroke(state.isOn() ? Color.DEFAULT : Color.INACTIVE);\n this._p.rect(this._hudBorderRect.x, this._hudBorderRect.y, this._hudBorderRect.w, this._hudBorderRect.h);\n this._p.pop();\n };\n /**\n * Helper method to draw a single cell on the HUD.\n * Identical in logic to DisplayRenderer's cell drawing but localized for HUD.\n *\n * @param {object} params - The drawing parameters.\n * @param {number} params.w - Width of the cell.\n * @param {number} params.posX - Absolute X position.\n * @param {number} params.posY - Absolute Y position.\n * @param {Color} params.color - Color of the cell.\n */\n HudRenderer.prototype.drawCellElement = function (_a) {\n var w = _a.w, posX = _a.posX, posY = _a.posY, color = _a.color;\n var _b = configs.screenLayout.cell, cellMargin = _b.margin, cellPadding = _b.padding, cellStrokeWeight = _b.strokeWeight;\n var innerOffset = cellMargin * w;\n var innerSize = w - cellMargin * w * 2;\n var paddingOffset = cellPadding * w;\n var paddingSize = w - cellPadding * w * 2;\n var strokeWeight = cellStrokeWeight * w;\n this._p.push();\n this._p.translate(posX, posY);\n this._p.strokeWeight(strokeWeight);\n this._p.stroke(color);\n // Outer Box\n this._p.noFill();\n this._p.rect(innerOffset, innerOffset, innerSize, innerSize);\n // Inner Fill\n this._p.fill(color);\n this._p.rect(paddingOffset, paddingOffset, paddingSize, paddingSize);\n this._p.pop();\n };\n return HudRenderer;\n}());\nexport default HudRenderer;\n","import DisplayRenderer from './DisplayRenderer';\nimport HudRenderer from './HudRenderer';\nimport configs from '../../../config/configs';\nimport RelativeValuesHelper from '../../helpers/RelativeValuesHelper';\nimport CoordinateHelper from '../../helpers/CoordinateHelper';\n/**\n * Composite renderer that manages multiple sub-renderers.\n * Orchestrates the rendering of the main display and the HUD.\n * Handles the calculation of shared rendering metrics (sizes, positions) to ensure consistency.\n */\nvar GameRenderer = /** @class */ (function () {\n /**\n * Creates an instance of GameRenderer.\n *\n * @param {p5} p - The p5 instance.\n */\n function GameRenderer(p) {\n this._p = p;\n }\n /**\n * Adds a sub-renderer to the composition.\n *\n * @param {Renderer} renderer - The renderer to add.\n */\n GameRenderer.prototype.addRenderer = function (renderer) {\n this._renderers.push(renderer);\n };\n /**\n * Initializes all sub-renderers and calculates layout metrics.\n * This method must be called before rendering begins.\n */\n GameRenderer.prototype.setup = function () {\n var _this = this;\n this._displayRenderer = new DisplayRenderer(this._p);\n this._hudRenderer = new HudRenderer(this._p);\n this._renderers = [];\n this.addRenderer(this._displayRenderer);\n this.addRenderer(this._hudRenderer);\n // Pre-calculate all metrics here to avoid dependency issues between renderers\n this._calculateMetrics();\n this._renderers.forEach(function (renderer) { return renderer.setup(_this.rendererMetrics); });\n };\n /**\n * Calculates the layout dimensions for the display and HUD.\n * Based on screen configuration and relative values.\n */\n GameRenderer.prototype._calculateMetrics = function () {\n var _a = configs.screenLayout.display, width = _a.width, height = _a.height, displayMargin = _a.margin;\n var gridColumns = configs.screenLayout.grid.columns;\n // 1. Calculate main display dimensions\n var displayWidth = RelativeValuesHelper.getRelativeWidth(this._p, width);\n var displayHeight = RelativeValuesHelper.getRelativeHeight(this._p, height);\n var displayOrigin = CoordinateHelper.getRelativeCoordinate(this._p, {\n x: displayMargin,\n y: displayMargin,\n });\n // 2. Calculate cell size\n var cellSize = displayWidth / gridColumns;\n // 3. Calculate HUD dimensions\n // Note: We use 0 and 1 to get start and end positions, then calculate width/height\n var hudOrigin = {\n x: CoordinateHelper.getHudPosX(this._p, 0, displayWidth),\n y: CoordinateHelper.getHudPosY(this._p, 0, displayHeight),\n };\n var hudWidth = CoordinateHelper.getHudPosX(this._p, 1, displayWidth) - hudOrigin.x;\n var hudHeight = CoordinateHelper.getHudPosY(this._p, 1, displayHeight) - hudOrigin.y;\n this._rendererMetrics = {\n display: {\n width: displayWidth,\n height: displayHeight,\n origin: displayOrigin,\n },\n hud: {\n width: hudWidth,\n height: hudHeight,\n origin: hudOrigin,\n },\n cell: {\n size: cellSize,\n },\n };\n };\n /**\n * Delegating render method.\n * Calls render on all registered sub-renderers.\n *\n * @param {Cell[][]} grid - The main game grid.\n * @param {GameModules} modules - The game modules collection.\n */\n GameRenderer.prototype.render = function (grid, modules) {\n this._renderers.forEach(function (renderer) { return renderer.render(grid, modules); });\n };\n Object.defineProperty(GameRenderer.prototype, \"rendererMetrics\", {\n /**\n * Retrieves the calculated renderer metrics.\n *\n * @returns {RendererMetrics} The metrics object.\n */\n get: function () {\n return this._rendererMetrics;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Retrieves debug information about the renderer's calculated metrics.\n *\n * @returns {Record<string, string | number | boolean>} The debug data.\n */\n GameRenderer.prototype.getDebugData = function () {\n return {\n display_width: this._rendererMetrics.display.width.toFixed(2),\n display_height: this._rendererMetrics.display.height.toFixed(2),\n hud_width: this._rendererMetrics.hud.width.toFixed(2),\n hud_height: this._rendererMetrics.hud.height.toFixed(2),\n cell_size: this._rendererMetrics.cell.size.toFixed(2),\n };\n };\n return GameRenderer;\n}());\nexport default GameRenderer;\n","var _a;\nimport { StateProperty } from '../../types/Types';\n// prettier-ignore\nvar STATE_CONFIG = (_a = {},\n _a[StateProperty.ON] = { defaultValue: false },\n _a[StateProperty.START] = { defaultValue: false },\n _a[StateProperty.PLAYING] = { defaultValue: false },\n _a[StateProperty.GAME_OVER] = { defaultValue: false },\n _a[StateProperty.COLOR_ENABLED] = { defaultValue: true, storageKey: 'colorEnabled' },\n _a[StateProperty.MUTED] = { defaultValue: false, storageKey: 'muted' },\n _a);\n/**\n * Manages the core boolean states of the game and handles state-change events.\n *\n * Provides a central hub for tracking game lifecycle states (on, running, gameOver)\n * and user preferences (color enabled).\n *\n *\n * **Persistence Responsibility:**\n * This class is the SOLE responsible for persisting and loading generic, cross-session\n * player preferences (like mute settings and color toggle) from LocalStorage.\n * It does NOT handle transient session data (GameSession) or specific scoring logic (GameScore).\n */\nvar GameState = /** @class */ (function () {\n function GameState() {\n this._state = new Map();\n /** Map to store property names and their associated subscription callbacks. */\n this._subscribers = new Map();\n }\n /**\n * Initializes the state module.\n * Sets default values for all state properties and loads persisted data.\n */\n GameState.prototype.setup = function () {\n var _this = this;\n // Initialize default values\n Object.values(StateProperty).forEach(function (property) {\n var config = STATE_CONFIG[property];\n _this._state.set(property, config.defaultValue);\n });\n this._loadPersistentState();\n };\n /**\n * Loads persistent state from LocalStorage.\n */\n GameState.prototype._loadPersistentState = function () {\n var _this = this;\n Object.values(StateProperty).forEach(function (property) {\n var config = STATE_CONFIG[property];\n if (config.storageKey) {\n var storedValue = localStorage.getItem(config.storageKey);\n if (storedValue !== null) {\n _this._state.set(property, JSON.parse(storedValue));\n }\n }\n });\n };\n /**\n * Sets a state property value, handling persistence and notification.\n *\n * @param {StateProperty} property - The property to set.\n * @param {boolean | number} value - The value to set.\n */\n GameState.prototype._set = function (property, value) {\n var currentValue = this._state.get(property);\n if (currentValue !== value) {\n this._state.set(property, value);\n var config = STATE_CONFIG[property];\n if (config.storageKey) {\n localStorage.setItem(config.storageKey, JSON.stringify(value));\n }\n this._notify(property, value);\n }\n };\n /**\n * Notifies all subscribers of a property change.\n *\n * @param {StateProperty} property - The property that changed.\n * @param {boolean | number} value - The new value of the property.\n */\n GameState.prototype._notify = function (property, value) {\n var callbacks = this._subscribers.get(property);\n if (callbacks) {\n callbacks.forEach(function (callback) { return callback(value); });\n }\n };\n /**\n * Checks if the game machine is powered on.\n *\n * @returns {boolean} True if powered on.\n */\n GameState.prototype.isOn = function () {\n return this._state.get(StateProperty.ON);\n };\n /**\n * Checks if the game machine is powered off.\n *\n * @returns {boolean} True if powered off.\n */\n GameState.prototype.isOff = function () {\n return !this.isOn();\n };\n /**\n * Checks if a game session has currently started.\n * This includes both playing and paused states.\n *\n * @returns {boolean} True if a game is active.\n */\n GameState.prototype.isStarted = function () {\n return this._state.get(StateProperty.START);\n };\n /**\n * Checks if the game is currently running (not paused, not game over).\n *\n * @returns {boolean} True if gameplay is active.\n */\n GameState.prototype.isPlaying = function () {\n return this._state.get(StateProperty.PLAYING);\n };\n /**\n * Checks if the game is paused.\n *\n * @returns {boolean} True if the game is started but not playing (and not game over).\n */\n GameState.prototype.isPaused = function () {\n return this.isStarted() && !this.isPlaying() && !this.isGameOver();\n };\n /**\n * Checks if the game is in a \"Game Over\" state.\n *\n * @returns {boolean} True if the game is over.\n */\n GameState.prototype.isGameOver = function () {\n return this._state.get(StateProperty.GAME_OVER);\n };\n /**\n * Powers on the game machine.\n * Resets all session states (start, playing, game over).\n */\n GameState.prototype.turnOn = function () {\n this._set(StateProperty.ON, true);\n this._set(StateProperty.START, false);\n this._set(StateProperty.PLAYING, false);\n this._set(StateProperty.GAME_OVER, false);\n };\n /**\n * Powers off the game machine.\n * Resets all states.\n */\n GameState.prototype.turnOff = function () {\n this._set(StateProperty.ON, false);\n this._set(StateProperty.START, false);\n this._set(StateProperty.PLAYING, false);\n this._set(StateProperty.GAME_OVER, false);\n };\n /**\n * Starts a new game session.\n * Only works if the machine is powered on.\n */\n GameState.prototype.startGame = function () {\n if (!this.isOn())\n return;\n this._set(StateProperty.START, true);\n this._set(StateProperty.PLAYING, true);\n this._set(StateProperty.GAME_OVER, false);\n };\n /**\n * Resets the game over state and starts the game again.\n */\n GameState.prototype.resetGameOver = function () {\n this._set(StateProperty.GAME_OVER, false);\n this._set(StateProperty.START, true);\n this._set(StateProperty.PLAYING, true);\n };\n /**\n * Exits the current game session, returning to the \"On\" state.\n */\n GameState.prototype.exitGame = function () {\n this._set(StateProperty.START, false);\n this._set(StateProperty.PLAYING, false);\n this._set(StateProperty.GAME_OVER, false);\n };\n /**\n * Pauses the current game.\n */\n GameState.prototype.pause = function () {\n if (this.isStarted() && !this.isGameOver()) {\n this._set(StateProperty.PLAYING, false);\n }\n };\n /**\n * Resumes the game from a paused state.\n */\n GameState.prototype.resume = function () {\n if (this.isStarted() && !this.isGameOver()) {\n this._set(StateProperty.PLAYING, true);\n }\n };\n /**\n * Triggers the \"Game Over\" state.\n * Stops gameplay.\n */\n GameState.prototype.triggerGameOver = function () {\n this._set(StateProperty.PLAYING, false);\n this._set(StateProperty.GAME_OVER, true);\n };\n /**\n * Resets the game to the initial state (restarts).\n */\n GameState.prototype.resetGame = function () {\n if (!this.isOn())\n return;\n this._set(StateProperty.GAME_OVER, false);\n this._set(StateProperty.START, true);\n this._set(StateProperty.PLAYING, true);\n };\n /**\n * Checks if color mode is enabled.\n *\n * @returns {boolean} True if color is enabled.\n */\n GameState.prototype.isColorEnabled = function () {\n return this._state.get(StateProperty.COLOR_ENABLED);\n };\n /**\n * Enables or disables color mode.\n *\n * @param {boolean} value - True to enable, false to disable.\n */\n GameState.prototype.setColorEnabled = function (value) {\n this._set(StateProperty.COLOR_ENABLED, value);\n };\n /**\n * Checks if audio is muted.\n *\n * @returns {boolean} True if muted.\n */\n GameState.prototype.isMuted = function () {\n return this._state.get(StateProperty.MUTED);\n };\n /**\n * Mutes or unmutes the audio.\n *\n * @param {boolean} value - True to mute, false to unmute.\n */\n GameState.prototype.setMuted = function (value) {\n this._set(StateProperty.MUTED, value);\n };\n /**\n * Toggles the color enabled state.\n */\n GameState.prototype.toggleColorEnabled = function () {\n this.setColorEnabled(!this.isColorEnabled());\n };\n /**\n * Toggles the muted state.\n */\n GameState.prototype.toggleMuted = function () {\n this.setMuted(!this.isMuted());\n };\n /**\n * Subscribes to changes in specific state properties.\n *\n * @param {StateProperty} property - The state property to monitor.\n * @param {function(boolean | number): void} callback - The function to execute when the property changes.\n */\n GameState.prototype.subscribe = function (property, callback) {\n var _a;\n if (!this._subscribers.has(property)) {\n this._subscribers.set(property, []);\n }\n (_a = this._subscribers.get(property)) === null || _a === void 0 ? void 0 : _a.push(callback);\n };\n /**\n * Unsubscribes from changes in specific state properties.\n *\n * @param {StateProperty} property - The state property to monitor.\n * @param {function(boolean | number): void} callback - The function to remove.\n */\n GameState.prototype.unsubscribe = function (property, callback) {\n var callbacks = this._subscribers.get(property);\n if (callbacks) {\n this._subscribers.set(property, callbacks.filter(function (cb) { return cb !== callback; }));\n }\n };\n /**\n * Retrieves debug information about the game state.\n *\n * @returns {Record<string, string | number | boolean>} The debug data.\n */\n GameState.prototype.getDebugData = function () {\n return {\n on: this.isOn(),\n start: this.isStarted(),\n playing: this.isPlaying(),\n paused: this.isPaused(),\n game_over: this.isGameOver(),\n color_enabled: this.isColorEnabled(),\n muted: this.isMuted(),\n };\n };\n return GameState;\n}());\nexport default GameState;\n","import configs from '../../../config/configs';\nimport { FontSize } from '../../types/enums';\nimport CoordinateHelper from '../../helpers/CoordinateHelper';\nimport RelativeValuesHelper from '../../helpers/RelativeValuesHelper';\n/**\n * Handles text rendering and font management within the game.\n *\n * This class orchestrates font initialization, sizing, alignment, and\n * provides methods to render text on specific areas (HUD or Display).\n */\nvar GameText = /** @class */ (function () {\n /**\n * Creates an instance of GameText.\n *\n * @param {p5} p - The p5 instance.\n */\n function GameText(p) {\n /** The default font family used for game text. */\n this.defaultFontFamily = 'retro-gamming';\n /** Array containing pre-calculated font sizes in pixels. */\n this.fontSizes = [0];\n this._p = p;\n }\n // prettier-ignore\n /**\n * Setup the font and pre-calculates relative font sizes.\n *\n * Uses configuration values to define a set of pixel-perfect font sizes\n * based on current container width.\n */\n GameText.prototype.setup = function () {\n var _a = configs.screenLayout.fontSize, extraSmall = _a.extraSmall, small = _a.small, medium = _a.medium, large = _a.large, extraLarge = _a.extraLarge;\n this._p.textFont(this.defaultFontFamily);\n // Define font sizes\n this.fontSizes = [];\n this.fontSizes[FontSize.EXTRA_SMALL] = RelativeValuesHelper.getRelativeWidth(this._p, extraSmall);\n this.fontSizes[FontSize.SMALL] = RelativeValuesHelper.getRelativeWidth(this._p, small);\n this.fontSizes[FontSize.MEDIUM] = RelativeValuesHelper.getRelativeWidth(this._p, medium);\n this.fontSizes[FontSize.LARGE] = RelativeValuesHelper.getRelativeWidth(this._p, large);\n this.fontSizes[FontSize.EXTRA_LARGE] = RelativeValuesHelper.getRelativeWidth(this._p, extraLarge);\n };\n /**\n * Sets the display metrics used for relative text positioning.\n *\n * @param {RendererMetrics} rendererMetrics - The current renderer dimensions and origin.\n */\n GameText.prototype.setRendererMetrics = function (rendererMetrics) {\n this._rendererMetrics = rendererMetrics;\n };\n /**\n * Sets the fill color of the text based on its state.\n *\n * @param {boolean} state - Whether the text should use the active or inactive color.\n */\n GameText.prototype.setTextState = function (state) {\n var _a = configs.colors, active = _a.active, inactive = _a.inactive;\n this._p.fill(state ? active : inactive);\n };\n /**\n * Sets the text color to the active theme color.\n */\n GameText.prototype.setActiveText = function () {\n this.setTextState(true);\n };\n /**\n * Sets the text color to the inactive theme color.\n */\n GameText.prototype.setInactiveText = function () {\n this.setTextState(false);\n };\n /**\n * Sets the current font size from predefined values.\n *\n * @param {FontSize} fontSize - The enum value representing the desired size.\n */\n GameText.prototype.setTextSize = function (fontSize) {\n this._p.textSize(this.fontSizes[fontSize]);\n };\n /**\n * Configures horizontal and vertical text alignment.\n *\n * @param {FontAlign} fontAlign - Horizontal alignment value.\n * @param {FontVerticalAlign} fontVerticalAlign - Vertical alignment value.\n */\n GameText.prototype.setTextAlign = function (fontAlign, fontVerticalAlign) {\n this._p.textAlign(fontAlign, fontVerticalAlign);\n };\n /**\n * Renders text on the HUD area using relative coordinates.\n *\n * @param {string} text - The string to be rendered.\n * @param {Coordinate} coordinate - Normalized coordinates (0 to 1) within the HUD area.\n */\n GameText.prototype.textOnHud = function (text, coordinate) {\n var x = CoordinateHelper.getHudPosX(this._p, coordinate.x, this._rendererMetrics.display.width);\n var y = CoordinateHelper.getHudPosY(this._p, coordinate.y, this._rendererMetrics.display.height);\n this._p.text(text, x, y);\n };\n /**\n * Renders text on the main display area using relative coordinates.\n *\n * @param {string} text - The string to be rendered.\n * @param {Coordinate} coordinate - Normalized coordinates (0 to 1) within the display area.\n */\n GameText.prototype.textOnDisplay = function (text, coordinate) {\n // Fixed argument order: (p, x, displayWidth)\n var x = CoordinateHelper.getDisplayPosX(this._p, coordinate.x, this._rendererMetrics.display.width);\n var y = CoordinateHelper.getDisplayPosY(this._p, coordinate.y, this._rendererMetrics.display.height);\n this._p.text(text, x, y);\n };\n /**\n * Retrieves debug information about the text system.\n *\n * @returns {Record<string, string | number | boolean>} The debug data.\n */\n GameText.prototype.getDebugData = function () {\n return {\n current_font_family: this.defaultFontFamily,\n font_sizes_count: this.fontSizes.length,\n };\n };\n return GameText;\n}());\nexport default GameText;\n","import configs from '../../../config/configs';\n/**\n * Manages game time, frame rates, and tick intervals.\n * Handles the game loop timing and debug statistics (FPS, TPS).\n */\nvar GameTime = /** @class */ (function () {\n function GameTime() {\n // Time accumulator\n this._accumulatedTime = 0;\n this._initialTickInterval = configs.game.tickInterval;\n this._minTickInterval = configs.game.minTickInterval;\n this._tickInterval = configs.game.tickInterval;\n this._fps = 0;\n this._tps = 0;\n this._tickCounter = 0;\n this._timeSinceLastTpsUpdate = 0;\n this.serialId = 'time';\n }\n /**\n * Initializes the time module.\n * Resets all timers and counters.\n */\n GameTime.prototype.setup = function () {\n this.reset();\n };\n /**\n * Updates the time accumulator and calculates FPS/TPS.\n * Should be called once per frame.\n *\n * @param {number} deltaTime - Time elapsed since last frame in milliseconds.\n */\n GameTime.prototype.update = function (deltaTime) {\n this._accumulatedTime += deltaTime;\n this._fps = 1000 / deltaTime;\n this._timeSinceLastTpsUpdate += deltaTime;\n if (this._timeSinceLastTpsUpdate >= 1000) {\n this._tps = this._tickCounter;\n this._tickCounter = 0;\n this._timeSinceLastTpsUpdate -= 1000;\n }\n };\n /**\n * Checks if enough time has passed for a game tick.\n * Consumes accumulated time if a tick occurs.\n *\n * @returns {boolean} True if a tick should occur.\n */\n GameTime.prototype.shouldTick = function () {\n if (this._accumulatedTime >= this._tickInterval) {\n this._accumulatedTime -= this._tickInterval;\n this._tickCounter++;\n return true;\n }\n return false;\n };\n /**\n * Resets the time accumulator and debug counters.\n */\n GameTime.prototype.reset = function () {\n this._accumulatedTime = 0;\n this._fps = 0;\n this._tps = 0;\n this._tickCounter = 0;\n this._timeSinceLastTpsUpdate = 0;\n this._tickInterval = this._initialTickInterval;\n };\n Object.defineProperty(GameTime.prototype, \"tickInterval\", {\n /**\n * Gets the current tick interval.\n *\n * @returns {number} The tick interval in milliseconds.\n */\n get: function () {\n return this._tickInterval;\n },\n /**\n * Sets the tick interval and resets timing.\n *\n * @param {number} interval - The new tick interval in milliseconds.\n */\n set: function (interval) {\n this._tickInterval = interval;\n // this.reset(); // Removed reset to prevent stuttering on speed change\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Increments the tick interval (slowing down the game).\n *\n * @param {number} amount - The amount to add to the interval.\n */\n GameTime.prototype.incrementTickInterval = function (amount) {\n this.tickInterval = this._tickInterval + amount;\n };\n /**\n * Decrements the tick interval (speeding up the game).\n * Enforces a minimum interval of 10ms.\n *\n * @param {number} amount - The amount to subtract from the interval.\n */\n GameTime.prototype.decrementTickInterval = function (amount) {\n var newInterval = Math.max(this._minTickInterval, this._tickInterval - amount);\n this.tickInterval = newInterval;\n };\n /**\n * Retrieves debug information about the time system.\n *\n * @returns {Record<string, string | number | boolean>} The debug data.\n */\n GameTime.prototype.getDebugData = function () {\n return {\n fps: Math.round(this._fps),\n tps: this._tps,\n tick_interval: this._tickInterval.toFixed(2),\n accumulated_time: this._accumulatedTime.toFixed(2),\n };\n };\n GameTime.prototype.serialize = function () {\n return JSON.stringify({\n tickInterval: this._tickInterval,\n });\n };\n GameTime.prototype.deserialize = function (data) {\n var parsed = JSON.parse(data);\n this._tickInterval = parsed.tickInterval;\n };\n GameTime.prototype.setTickInterval = function (interval) {\n this._tickInterval = interval;\n };\n GameTime.prototype.setMinTickInterval = function (interval) {\n this._minTickInterval = interval;\n };\n return GameTime;\n}());\nexport default GameTime;\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport configs from '../../../config/configs';\nimport { Sound, StateProperty } from '../../types/enums';\n/**\n * Manages audio playback and sound effects.\n * Handles the Web Audio API context, loading sound buffers, and managing volume/muting.\n */\nvar GameSound = /** @class */ (function () {\n function GameSound() {\n /**\n * Stores loaded sound buffers in memory.\n * AudioBuffer contains the decoded audio data ready for playback.\n */\n this._buffers = new Map();\n /**\n * Tracks currently playing sound sources.\n * Required to stop specific sounds (like background music or loops).\n */\n this._activeSources = new Map();\n this._volume = 1.0;\n }\n /**\n * Initializes the sound system.\n * Creates the AudioContext, sets up the master gain node, and starts loading sounds.\n */\n GameSound.prototype.setup = function () {\n var volume = configs.game.sound.volume;\n this._volume = volume;\n // Initialize AudioContext.\n // The 'webkit' prefix is for compatibility with older browsers (e.g., older Safari).\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var AudioContextClass = window.AudioContext || window.webkitAudioContext;\n this._audioContext = new AudioContextClass({ latencyHint: 'interactive' });\n // Create the master volume node (GainNode).\n this._gainNode = this._audioContext.createGain();\n // Connect the GainNode to the \"destination\" (device audio output).\n // Flow: Sound Source -> GainNode -> Destination (Speakers)\n this._gainNode.connect(this._audioContext.destination);\n this._updateGain();\n this._loadAll();\n };\n /**\n * Plays a specific sound effect.\n * Creates a new source node for each playback instance.\n *\n * @param {Sound} sound - The sound identifier/URL to play.\n * @returns {Promise<void>}\n */\n GameSound.prototype.play = function (sound) {\n return __awaiter(this, void 0, void 0, function () {\n var buffer, source, sources;\n return __generator(this, function (_a) {\n // Browsers block automatic audio until user interaction.\n // If suspended, try to wake up the AudioContext.\n if (this._audioContext.state === 'suspended') {\n this._audioContext.resume();\n }\n buffer = this._buffers.get(sound);\n if (!buffer) {\n console.warn(\"Sound buffer not found for: \".concat(sound));\n return [2 /*return*/];\n }\n source = this._audioContext.createBufferSource();\n source.buffer = buffer;\n // Connect the source to our master volume control.\n source.connect(this._gainNode);\n // Track the active source so we can stop it if necessary.\n if (!this._activeSources.has(sound)) {\n this._activeSources.set(sound, []);\n }\n sources = this._activeSources.get(sound);\n sources.push(source);\n // When the sound finishes playing, remove from active list to free memory.\n source.onended = function () {\n var index = sources.indexOf(source);\n if (index > -1) {\n sources.splice(index, 1);\n }\n };\n // Start playback immediately (0).\n source.start(0);\n return [2 /*return*/];\n });\n });\n };\n /**\n * Stops all instances of a specific sound.\n *\n * @param {Sound} sound - The sound to stop.\n * @returns {Promise<void>}\n */\n GameSound.prototype.stop = function (sound) {\n return __awaiter(this, void 0, void 0, function () {\n var sources;\n return __generator(this, function (_a) {\n sources = this._activeSources.get(sound);\n if (sources) {\n sources.forEach(function (source) {\n try {\n // Stop playback immediately.\n source.stop();\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n }\n catch (e) {\n // Ignore errors if already stopped.\n }\n });\n sources.length = 0;\n }\n return [2 /*return*/];\n });\n });\n };\n /**\n * Stops all currently playing sounds.\n *\n * @returns {Promise<void>}\n */\n GameSound.prototype.stopAll = function () {\n return __awaiter(this, void 0, void 0, function () {\n var activeSounds, _i, activeSounds_1, sound;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n activeSounds = Array.from(this._activeSources.keys());\n _i = 0, activeSounds_1 = activeSounds;\n _a.label = 1;\n case 1:\n if (!(_i < activeSounds_1.length)) return [3 /*break*/, 4];\n sound = activeSounds_1[_i];\n return [4 /*yield*/, this.stop(sound)];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3:\n _i++;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n /**\n * Updates the master volume based on the muted state.\n */\n GameSound.prototype._updateGain = function () {\n // setValueAtTime is the safe way to change audio parameters in Web Audio API.\n // If muted, volume is 0. Otherwise, use configured volume.\n var isMuted = this._state ? this._state.isMuted() : false;\n if (!this._gainNode) {\n return;\n }\n if (isMuted) {\n this._gainNode.gain.setValueAtTime(0, this._audioContext.currentTime);\n }\n else {\n this._gainNode.gain.setValueAtTime(this._volume, this._audioContext.currentTime);\n }\n };\n /**\n * Loads all sound assets defined in the Sound enum.\n * Fetches, buffers, and decodes the audio data.\n */\n GameSound.prototype._loadAll = function () {\n return __awaiter(this, void 0, void 0, function () {\n var loadPromises;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n loadPromises = Object.values(Sound).map(function (soundUrl) { return __awaiter(_this, void 0, void 0, function () {\n var response, arrayBuffer, audioBuffer, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 4, , 5]);\n return [4 /*yield*/, fetch(soundUrl)];\n case 1:\n response = _a.sent();\n return [4 /*yield*/, response.arrayBuffer()];\n case 2:\n arrayBuffer = _a.sent();\n return [4 /*yield*/, this._audioContext.decodeAudioData(arrayBuffer)];\n case 3:\n audioBuffer = _a.sent();\n this._buffers.set(soundUrl, audioBuffer);\n return [3 /*break*/, 5];\n case 4:\n error_1 = _a.sent();\n console.error(\"Failed to load sound: \".concat(soundUrl), error_1);\n return [3 /*break*/, 5];\n case 5: return [2 /*return*/];\n }\n });\n }); });\n return [4 /*yield*/, Promise.all(loadPromises)];\n case 1:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * Toggles the mute state of the game.\n * Updates the state module and the audio gain.\n */\n GameSound.prototype.toggleMute = function () {\n this._state.toggleMuted();\n this._updateGain();\n };\n /**\n * Receives the shared game state module.\n * Subscribes to mute state changes.\n *\n * @param {State} state - The game state module.\n */\n GameSound.prototype.syncState = function (state) {\n var _this = this;\n this._state = state;\n state.subscribe(StateProperty.MUTED, function () {\n _this._updateGain();\n });\n // Ensure the initial state is applied when synced\n this._updateGain();\n };\n /**\n * Retrieves debug information about the audio system.\n *\n * @returns {Record<string, string | number | boolean>} The debug data.\n */\n GameSound.prototype.getDebugData = function () {\n var activeSourcesCount = 0;\n this._activeSources.forEach(function (sources) { return (activeSourcesCount += sources.length); });\n return {\n muted: this._state ? this._state.isMuted() : false,\n volume: this._volume,\n active_sources: activeSourcesCount,\n loaded_buffers: this._buffers.size,\n };\n };\n return GameSound;\n}());\nexport default GameSound;\n","/**\n * Manages game scoring, levels, and high score tracking.\n * Acts as the authority for the game's `highScore`, persisting it directly to `LocalStorage`.\n * Handles multipliers and supports Session serialization out of the box.\n */\nvar GameScore = /** @class */ (function () {\n function GameScore() {\n this._score = 0;\n this._multiplier = 1;\n this._level = 1;\n this._maxLevel = 10;\n this._highScore = 0;\n this.serialId = 'score';\n }\n /**\n * Initializes the score module.\n * Currently a no-op but required by interface.\n */\n GameScore.prototype.setup = function () {\n this._highScore = Number(localStorage.getItem('highScore'));\n };\n /**\n * Increases the score by the given amount, applying the current multiplier.\n * Automatically checks for high score updates.\n *\n * @param {number} amount - The base amount to increase by.\n */\n GameScore.prototype.increaseScore = function (amount) {\n this._score += amount * this._multiplier;\n if (this._score > this._highScore) {\n this.highScore = this._score;\n }\n };\n /**\n * Resets the current score to 0.\n */\n GameScore.prototype.resetScore = function () {\n this._score = 0;\n };\n /**\n * Formats the current score as a string with leading zeros.\n *\n * @param {number} [digits=6] - The total number of digits to display.\n * @returns {string} The formatted score string (e.g., \"000150\").\n */\n GameScore.prototype.getFormattedScore = function (digits) {\n if (digits === void 0) { digits = 6; }\n return this._score.toString().padStart(digits, '0');\n };\n /**\n * Increases the game level by a specific amount.\n *\n * @param {number} amount - The number of levels to add.\n */\n GameScore.prototype.increaseLevel = function (amount) {\n this._level += amount;\n };\n /**\n * Resets the game level back to 1.\n */\n GameScore.prototype.resetLevel = function () {\n this._level = 1;\n };\n Object.defineProperty(GameScore.prototype, \"multiplier\", {\n /**\n * Gets the current score multiplier.\n *\n * @returns {number} The active multiplier.\n */\n get: function () {\n return this._multiplier;\n },\n /**\n * Sets the score multiplier.\n *\n * @param {number} value - The new multiplier value.\n */\n set: function (value) {\n this._multiplier = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GameScore.prototype, \"level\", {\n /**\n * Gets the current level.\n *\n * @returns {number} The current level.\n */\n get: function () {\n return this._level;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GameScore.prototype, \"score\", {\n /**\n * Gets the current raw score.\n *\n * @returns {number} The current score value.\n */\n get: function () {\n return this._score;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GameScore.prototype, \"maxLevel\", {\n /**\n * Gets the maximum achievable level (if defined).\n *\n * @returns {number} The max level.\n */\n get: function () {\n return this._maxLevel;\n },\n /**\n * Sets the maximum game level.\n *\n * @param {number} value - The max level cap.\n */\n set: function (value) {\n this._maxLevel = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GameScore.prototype, \"highScore\", {\n /**\n * Gets the current high score.\n *\n * @returns {number} The current high score.\n */\n get: function () {\n return this._highScore;\n },\n /**\n * Sets the high score.\n *\n * @param {number} value - The new high score.\n */\n set: function (value) {\n this._highScore = value;\n localStorage.setItem('highScore', value.toString());\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Retrieves debug information about the score status.\n *\n * @returns {Record<string, string | number | boolean>} The debug data.\n */\n GameScore.prototype.getDebugData = function () {\n return {\n score: this._score,\n multiplier: this._multiplier,\n level: this._level,\n max_level: this._maxLevel,\n };\n };\n /**\n * Serializes the current score and level progress into a JSON string.\n * This is used by the SessionManager to save transient state.\n *\n * @returns {string} The serialized JSON data.\n */\n GameScore.prototype.serialize = function () {\n return JSON.stringify({\n score: this._score,\n multiplier: this._multiplier,\n level: this._level,\n max_level: this._maxLevel,\n });\n };\n /**\n * Restores score and level progress from a serialized JSON string.\n * Used by the SessionManager when recovering an active session.\n *\n * @param {string} data - The JSON string containing the saved session data.\n */\n GameScore.prototype.deserialize = function (data) {\n var parsed = JSON.parse(data);\n this._score = parsed.score;\n this._multiplier = parsed.multiplier;\n this._level = parsed.level;\n this._maxLevel = parsed.max_level;\n };\n return GameScore;\n}());\nexport default GameScore;\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport GameGrid from './GameGrid';\n/**\n * A specialized grid implementation for the Heads-Up Display (HUD).\n * Typically used for previewing the \"next piece\" in Tetris-like games.\n * It has fixed dimensions (usually 4x4).\n */\nvar GameHudGrid = /** @class */ (function (_super) {\n __extends(GameHudGrid, _super);\n function GameHudGrid() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.serialId = 'hud_grid';\n return _this;\n }\n Object.defineProperty(GameHudGrid.prototype, \"width\", {\n /**\n * The fixed width of the HUD grid.\n *\n * @returns {number} Always returns 4.\n */\n get: function () {\n return 4;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GameHudGrid.prototype, \"height\", {\n /**\n * The fixed height of the HUD grid.\n *\n * @returns {number} Always returns 4.\n */\n get: function () {\n return 4;\n },\n enumerable: false,\n configurable: true\n });\n GameHudGrid.prototype.serialize = function () {\n return JSON.stringify({\n grid: this._grid,\n });\n };\n GameHudGrid.prototype.deserialize = function (data) {\n var parsed = JSON.parse(data);\n this._grid = parsed.grid;\n };\n return GameHudGrid;\n}(GameGrid));\nexport default GameHudGrid;\n","import GameState from '../module/state/GameState';\nvar InterfaceIdentifierHelper = /** @class */ (function () {\n function InterfaceIdentifierHelper() {\n }\n InterfaceIdentifierHelper.isSerializable = function (module) {\n if (module === null || module === undefined)\n return false;\n var serializable = module;\n var hasSerialize = typeof serializable.serialize === 'function';\n var hasDeserialize = typeof serializable.deserialize === 'function';\n var hasSerialId = typeof serializable.serialId === 'string';\n return hasSerialize && hasDeserialize && hasSerialId;\n };\n InterfaceIdentifierHelper.isInitializable = function (module) {\n if (module === null || module === undefined)\n return false;\n var initializable = module;\n return typeof initializable.setup === 'function';\n };\n InterfaceIdentifierHelper.isStateSyncable = function (module) {\n if (module === null || module === undefined)\n return false;\n var stateSyncable = module;\n var hasSyncState = typeof stateSyncable.syncState === 'function';\n var isGameState = stateSyncable instanceof GameState;\n return hasSyncState && !isGameState;\n };\n InterfaceIdentifierHelper.isDebuggable = function (module) {\n if (module === null || module === undefined)\n return false;\n var debuggable = module;\n return typeof debuggable.getDebugData === 'function';\n };\n return InterfaceIdentifierHelper;\n}());\nexport default InterfaceIdentifierHelper;\n","var InitialStateSnapshot = /** @class */ (function () {\n function InitialStateSnapshot() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._initialState = new Map();\n this._baseProperties = [];\n }\n /**\n * Captures the base properties of the instance before any custom client properties are added.\n * @param instance The object instance to extract keys from.\n */\n InitialStateSnapshot.prototype.captureBaseProperties = function (instance) {\n this._baseProperties = Object.keys(instance);\n };\n /**\n * Stores the initial state of custom client properties.\n * @param instance The object instance containing custom properties.\n */\n InitialStateSnapshot.prototype.captureInitialState = function (instance) {\n var _this = this;\n console.log('capturing initial state for snapshot');\n Object.entries(instance).forEach(function (_a) {\n var key = _a[0], value = _a[1];\n if (!_this._baseProperties.includes(key) && typeof value !== 'function') {\n var initialValue = value;\n try {\n initialValue = structuredClone(value);\n console.log('capturing property', key, initialValue);\n }\n catch (e) {\n console.error(\"Failed to clone property \".concat(key, \":\"), e);\n }\n _this._initialState.set(key, initialValue);\n }\n });\n };\n /**\n * Restores the captured custom properties back to the instance.\n * @param instance The object instance to restore properties onto.\n */\n InitialStateSnapshot.prototype.restoreInitialState = function (instance) {\n console.log('restoring initial snapshot');\n this._initialState.forEach(function (value, key) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n instance[key] = value;\n console.log('restoring property', key, value);\n });\n };\n return InitialStateSnapshot;\n}());\nexport default InitialStateSnapshot;\n","import { StateProperty } from '../../types/enums';\nvar GameSession = /** @class */ (function () {\n function GameSession() {\n this._isModalClosed = false;\n this._serializables = [];\n }\n GameSession.prototype.register = function (serializable) {\n this._serializables.push(serializable);\n };\n GameSession.prototype.saveSession = function () {\n var _this = this;\n if (!this._isModalClosed || this._isGameMenuInstance())\n return;\n this._serializables.forEach(function (serializable) {\n localStorage.setItem(_this._key(serializable.serialId), serializable.serialize());\n });\n };\n GameSession.prototype.clearSession = function () {\n var _this = this;\n this._serializables.forEach(function (serializable) {\n localStorage.removeItem(_this._key(serializable.serialId));\n });\n };\n GameSession.prototype.setShowModalFunction = function (showModal) {\n this._showSessionModal = showModal;\n };\n GameSession.prototype._isGameMenuInstance = function () {\n return this.gameId === 'game-menu';\n };\n GameSession.prototype._hasSession = function () {\n var _this = this;\n return this._serializables.every(function (serializable) { return localStorage.getItem(_this._key(serializable.serialId)) !== null; });\n };\n GameSession.prototype._loadSession = function () {\n var _this = this;\n this._serializables.forEach(function (serializable) {\n var data = localStorage.getItem(_this._key(serializable.serialId));\n if (data) {\n serializable.deserialize(data);\n }\n });\n };\n GameSession.prototype._destroySession = function () {\n var _this = this;\n this._serializables.forEach(function (serializable) {\n localStorage.removeItem(_this._key(serializable.serialId));\n });\n };\n GameSession.prototype.syncState = function (state) {\n var _this = this;\n state.subscribe(StateProperty.PLAYING, function (isPlaying) {\n if (isPlaying && _this._isModalClosed === false) {\n if (!_this._hasSession() || _this._isGameMenuInstance()) {\n _this._isModalClosed = true;\n return;\n }\n _this._showSessionModal(function () {\n if (_this._hasSession() && !_this._isGameMenuInstance()) {\n _this._loadSession();\n }\n _this._isModalClosed = true;\n }, function () {\n _this._destroySession();\n _this._isModalClosed = true;\n });\n }\n });\n state.subscribe(StateProperty.GAME_OVER, function (isGameOver) {\n if (isGameOver) {\n _this._destroySession();\n }\n });\n state.subscribe(StateProperty.ON, function (isOn) {\n if (!isOn) {\n _this._isModalClosed = false;\n }\n });\n };\n GameSession.prototype.getDebugData = function () {\n return {\n gameId: this.gameId,\n serializables: this._serializables.map(function (serializable) { return serializable.serialId; }).join(', '),\n };\n };\n GameSession.prototype._key = function (key) {\n return \"\".concat(this.gameId, \"::\").concat(key);\n };\n return GameSession;\n}());\nexport default GameSession;\n","import GameControl from './module/control/GameControl';\nimport GameGrid from './module/grid/GameGrid';\nimport GameRenderer from './module/renderer/GameRenderer';\nimport GameState from './module/state/GameState';\nimport GameText from './module/text/GameText';\nimport GameTime from './module/time/GameTime';\nimport GameSound from './module/sound/GameSound';\nimport GameScore from './module/score/GameScore';\nimport { ControlEventType, ControlKey, StateProperty } from './types/Types';\nimport GameHudGrid from './module/grid/GameHudGrid';\nimport InterfaceIdentifierHelper from './helpers/InterfaceIdentifierHelper';\nimport InitialStateSnapshot from './InitialStateSnapshot';\nimport GameSession from './module/session/GameSession';\n/**\n * Base abstract class for the game.\n *\n * It manages the game loop, initialization of core modules, and integration with p5.js.\n * All game logic should be implemented in subclasses by overriding `processTick` and `processFrame`.\n */\nvar Game = /** @class */ (function () {\n /**\n * Creates an instance of the Game.\n *\n * @param {p5} p - The p5 instance.\n * @param {GameView} view - The view strategy associated with this game.\n */\n function Game(p, view) {\n this._modules = undefined;\n this._initialStateSnapshot = new InitialStateSnapshot();\n this._gameId = 'unknown';\n this._switchHandler = undefined;\n this._p = p;\n this._view = view;\n this._initialStateSnapshot.captureBaseProperties(this);\n }\n Object.defineProperty(Game.prototype, \"gameId\", {\n /**\n * Gets the game ID\n */\n get: function () {\n return this._gameId;\n },\n /**\n * Sets the game ID\n */\n set: function (id) {\n this._gameId = id;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Registers the callback to be used when a game requests to switch to another game.\n * This is typically called by the engine's main loop (index.ts).\n * @param handler The callback function.\n */\n Game.prototype.setSwitchHandler = function (handler) {\n this._switchHandler = handler;\n };\n /**\n * Propagates the switch handler to the new game.\n * @param game Game instance that has the switch handler.\n */\n Game.prototype.propagateSwitchHandler = function (game) {\n this.setSwitchHandler(game._switchHandler);\n };\n Object.defineProperty(Game.prototype, \"view\", {\n /**\n * Gets the game view.\n *\n * @returns {GameView} The game view instance.\n */\n get: function () {\n return this._view;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Switches execution to a new game instance.\n * Use this instead of global window methods.\n *\n * @param {Game} newGame - The new game instance to load.\n */\n Game.prototype.switchGame = function (newGame) {\n this.destroy(); // Clean up current game\n if (this._switchHandler) {\n this._switchHandler(newGame);\n }\n else {\n console.error('Game switch handler not registered. Cannot switch game.');\n }\n };\n Object.defineProperty(Game.prototype, \"modules\", {\n /**\n * Gets the game modules.\n *\n * @returns {GameModules} The collection of initialized game modules.\n */\n get: function () {\n return this._modules;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Sets up the game, initializing all modules and viewing components.\n * Called automatically by the engine key sequence.\n */\n Game.prototype.setup = function () {\n var _this = this;\n this._view.build();\n this._modules = {\n renderer: new GameRenderer(this._p),\n grid: new GameGrid(),\n hudGrid: new GameHudGrid(),\n text: new GameText(this._p),\n state: new GameState(),\n control: new GameControl(),\n time: new GameTime(),\n sound: new GameSound(),\n score: new GameScore(),\n session: new GameSession(),\n };\n Object.values(this._modules).forEach(function (module) {\n if (InterfaceIdentifierHelper.isInitializable(module)) {\n module.setup();\n }\n });\n Object.values(this._modules).forEach(function (module) {\n if (InterfaceIdentifierHelper.isStateSyncable(module)) {\n module.syncState(_this._modules.state);\n }\n });\n Object.values(this._modules).forEach(function (module) {\n if (InterfaceIdentifierHelper.isSerializable(module)) {\n _this._modules.session.register(module);\n }\n });\n var _a = this._modules, text = _a.text, control = _a.control, renderer = _a.renderer, session = _a.session;\n session.gameId = this.gameId;\n session.setShowModalFunction(this._view.showSessionModal.bind(this._view));\n control.setModules(this._modules);\n text.setRendererMetrics(renderer.rendererMetrics);\n this.setupGame();\n this._initialStateSnapshot.captureInitialState(this);\n this._subscribeSystemControls();\n this._view.bindControls(control);\n };\n /**\n * Main draw loop, called by p5.js.\n * Handles time updates, logic ticks, and rendering.\n */\n Game.prototype.draw = function () {\n if (!this._modules)\n return;\n var _a = this._modules, renderer = _a.renderer, grid = _a.grid, time = _a.time, state = _a.state;\n renderer.render(grid.getGrid(), this._modules);\n if (state.isOn()) {\n if (!state.isStarted()) {\n this.drawTitleScreen();\n }\n else if (state.isPlaying()) {\n time.update(this._p.deltaTime);\n // Update time accumulator\n // Process Logic Tick\n if (time.shouldTick()) {\n this.update(this._p.deltaTime);\n this._modules.session.saveSession();\n }\n this.render();\n }\n else if (state.isPaused()) {\n this.render();\n }\n if (state.isGameOver()) {\n this.drawGameOverScreen();\n }\n }\n };\n /**\n * Destroys the game instance, cleaning up all event listeners and stopping the loop.\n * Call this before switching to another game or when the game is no longer needed.\n */\n Game.prototype.destroy = function () {\n this._p.noLoop();\n if (this._modules) {\n this._modules.control.unbindControls();\n this._modules.sound.stopAll();\n }\n };\n Object.defineProperty(Game.prototype, \"p\", {\n get: function () {\n return this._p;\n },\n enumerable: false,\n configurable: true\n });\n Game.prototype._subscribeSystemControls = function () {\n var _this = this;\n var _a = this._modules, control = _a.control, state = _a.state, grid = _a.grid;\n control.subscribe(ControlKey.POWER, ControlEventType.PRESSED, function () {\n if (state.isOn()) {\n state.turnOff();\n _this.modules.sound.stopAll();\n }\n else {\n state.turnOn();\n }\n });\n control.subscribe(ControlKey.SOUND, ControlEventType.PRESSED, function () { return state.toggleMuted(); });\n control.subscribe(ControlKey.COLOR, ControlEventType.PRESSED, function () { return state.toggleColorEnabled(); });\n control.subscribe(ControlKey.RESET, ControlEventType.PRESSED, function () {\n grid.resetGrid();\n _this.modules.score.resetScore();\n _this.modules.score.resetLevel();\n _this.modules.time.reset();\n _this._modules.session.clearSession();\n state.resetGame();\n _this._initialStateSnapshot.restoreInitialState(_this);\n });\n control.subscribe(ControlKey.EXIT, ControlEventType.PRESSED, function () {\n _this._modules.session.clearSession();\n });\n control.subscribe(ControlKey.START_PAUSE, ControlEventType.PRESSED, function () {\n if (!state.isStarted()) {\n state.startGame();\n }\n else if (state.isPlaying()) {\n state.pause();\n }\n else if (state.isPaused()) {\n state.resume();\n }\n else if (state.isGameOver()) {\n grid.resetGrid();\n _this.modules.score.resetScore();\n _this.modules.score.resetLevel();\n _this.modules.time.reset();\n _this.modules.session.clearSession();\n _this._initialStateSnapshot.restoreInitialState(_this);\n state.resetGameOver();\n }\n });\n state.subscribe(StateProperty.ON, function (isOn) {\n if (!isOn) {\n grid.resetGrid();\n _this.modules.score.resetScore();\n _this.modules.score.resetLevel();\n _this.modules.time.reset();\n }\n });\n };\n return Game;\n}());\nexport default Game;\n","var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return\"string\"==typeof r?r.length>0:\"number\"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?\"0\"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,p=/^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s+([+-]?\\d*\\.?\\d+)%\\s+([+-]?\\d*\\.?\\d+)%\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,v=/^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,m=/^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},\"hex\"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},\"rgb\"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u=\"deg\"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},\"hsl\"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},\"rgb\"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},\"hsl\"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},\"hsv\"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return\"string\"==typeof r?N(r.trim(),y.string):\"object\"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):\"\",\"#\"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?\"rgba(\"+t+\", \"+n+\", \"+e+\", \"+u+\")\":\"rgb(\"+t+\", \"+n+\", \"+e+\")\";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?\"hsla(\"+t+\", \"+n+\"%, \"+e+\"%, \"+u+\")\":\"hsl(\"+t+\", \"+n+\"%, \"+e+\"%)\";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return\"number\"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return\"number\"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};export{j as Colord,w as colord,k as extend,I as getFormat,E as random};\n","/**\n * Creates a standard directional button.\n *\n * These buttons are used for the D-pad controls (Up, Down, Left, Right).\n *\n * @param p - The p5 instance.\n * @param container - The container element to attach the button to.\n * @param label - The text label for the button.\n * @returns The created button element.\n */\nexport default function Button(p, container, label) {\n //Container\n var buttonContainer = p.createDiv();\n buttonContainer.parent(container);\n buttonContainer.addClass('btn-container');\n //Button\n var button = p.createButton(label);\n button.parent(buttonContainer);\n button.addClass('btn');\n //Label\n // const paragraph = p.createP(label);\n // paragraph.parent(buttonContainer);\n // paragraph.addClass('btn-p');\n return button;\n}\n","/**\n * Creates a small system button (e.g., Reset, Sound).\n *\n * These buttons have a distinct style and include a visible paragraph label next to them.\n *\n * @param {p5} p - The p5 instance.\n * @param {p5.Element} container - The container element to attach the button to.\n * @param {string} label - The visible text label displayed near the button.\n * @param {boolean} top - Determines position/styling nuance (e.g. if it belongs to the top row of small buttons).\n * @returns {p5.Element} The created button element.\n */\nexport default function SmallButton(p, container, label, top) {\n //Container\n var buttonContainer = p.createDiv();\n buttonContainer.parent(container);\n buttonContainer.addClass('sm-btn-container');\n buttonContainer.addClass(top ? 'sm-btn-container-top' : 'sm-btn-container-bottom');\n //Button\n var button = p.createButton('');\n button.parent(buttonContainer);\n button.addClass('sm-btn');\n //Label\n var paragraph = p.createP(label);\n paragraph.parent(buttonContainer);\n paragraph.addClass('sm-btn-p');\n return button;\n}\n","import configs from '../config/configs';\nvar NewDebugger = /** @class */ (function () {\n function NewDebugger(gameModules, p) {\n this._moduleElements = [];\n this._gameModules = gameModules;\n this._p = p;\n }\n NewDebugger.prototype.setup = function () {\n var _this = this;\n if (!configs.game.debugger.enabled)\n return;\n var existingDetails = this._p.select('#debugger');\n var wasOpen = existingDetails ? existingDetails.elt.hasAttribute('open') : false;\n var openModules = new Set();\n if (existingDetails) {\n var modules = this._p.selectAll('.debugger-module');\n modules.forEach(function (module) {\n if (module.elt.hasAttribute('open')) {\n openModules.add(module.id());\n }\n });\n existingDetails.remove();\n }\n this._moduleElements = [];\n var details = this._p.createElement('details');\n details.id('debugger');\n if (wasOpen)\n details.attribute('open', '');\n details.parent(this._p.select('body'));\n var summary = this._p.createElement('summary');\n summary.id('debugger-summary');\n summary.html('Debug');\n summary.parent(details);\n Object.entries(this._gameModules).forEach(function (_a) {\n var name = _a[0], module = _a[1];\n if ('getDebugData' in module) {\n var moduleProperty_1 = {\n module: module,\n properties: [],\n };\n var moduleDetails_1 = _this._p.createElement('details');\n moduleDetails_1.class('debugger-module');\n moduleDetails_1.id(\"debugger-\".concat(name));\n if (openModules.has(\"debugger-\".concat(name))) {\n moduleDetails_1.attribute('open', '');\n }\n moduleDetails_1.parent(details);\n var moduleSummary = _this._p.createElement('summary');\n moduleSummary.id(\"debugger-\".concat(name, \"-summary\"));\n moduleSummary.html(name);\n moduleSummary.class('debugger-module-summary');\n moduleSummary.parent(moduleDetails_1);\n var moduleData = module.getDebugData();\n Object.entries(moduleData).forEach(function (_a) {\n var key = _a[0], value = _a[1];\n var dataElement = _this._p.createElement('div');\n dataElement.class('debugger-container');\n dataElement.id(\"debugger-container-\".concat(key, \"-\").concat(value));\n dataElement.parent(moduleDetails_1);\n dataElement.mouseClicked(function () {\n dataElement.toggleClass('highlight');\n });\n var dataKeyElement = _this._p.createElement('p');\n dataKeyElement.id(\"debugger-\".concat(key, \"-\").concat(value));\n dataKeyElement.html(\"\".concat(key, \":\"));\n dataKeyElement.parent(dataElement);\n var dataValueElement = _this._p.createElement('span');\n dataValueElement.id(\"debugger-\".concat(key, \"-\").concat(value, \"-value\"));\n dataValueElement.html(\"\".concat(value));\n dataValueElement.parent(dataElement);\n moduleProperty_1.properties.push({\n key: key,\n element: dataValueElement,\n });\n });\n _this._moduleElements.push(moduleProperty_1);\n }\n });\n };\n NewDebugger.prototype.setGameModules = function (gameModules) {\n this._gameModules = gameModules;\n this.setup();\n };\n NewDebugger.prototype.update = function () {\n this._moduleElements.forEach(function (moduleProperty) {\n var data = moduleProperty.module.getDebugData();\n moduleProperty.properties.forEach(function (property) {\n property.element.html(\"\".concat(data[property.key]));\n });\n });\n };\n return NewDebugger;\n}());\nexport default NewDebugger;\n","var SessionModal = /** @class */ (function () {\n function SessionModal(p) {\n this._p = p;\n }\n SessionModal.prototype.setup = function () {\n this._container = this._p.createDiv();\n this._container.parent(this._p.select('body'));\n this._container.id('modal-background');\n this._container.class('hidden');\n var modal = this._p.createDiv();\n modal.parent(this._container);\n modal.id('session-modal');\n var frame = this._p.createDiv();\n frame.parent(modal);\n frame.id('session-modal-frame');\n var title = this._p.createP();\n title.parent(frame);\n title.html('Brick Engine Session');\n var screen = this._p.createDiv();\n screen.parent(frame);\n screen.id('session-modal-screen');\n var screenText = this._p.createP();\n screenText.parent(screen);\n screenText.html('<span>Looks like you have an active session.</span><br><br>Do you want to continue?');\n var buttonsContainer = this._p.createDiv();\n buttonsContainer.parent(modal);\n buttonsContainer.id('session-modal-buttons');\n this._cancelButton = this._p.createButton('Cancel');\n this._cancelButton.parent(buttonsContainer);\n this._cancelButton.class('session-modal-button');\n this._confirmButton = this._p.createButton('Confirm');\n this._confirmButton.parent(buttonsContainer);\n this._confirmButton.class('session-modal-button');\n };\n SessionModal.prototype.show = function (onConfirm, onCancel) {\n var _this = this;\n this._confirmButton.mousePressed(function () {\n onConfirm();\n _this._hide();\n });\n this._cancelButton.mousePressed(function () {\n onCancel();\n _this._hide();\n });\n this._container.removeClass('hidden');\n };\n SessionModal.prototype._hide = function () {\n this._confirmButton.mousePressed(null);\n this._cancelButton.mousePressed(null);\n this._container.addClass('hidden');\n };\n return SessionModal;\n}());\nexport default SessionModal;\n","import configs from '../config/configs';\nimport applyColors from './theme/applyColors';\nimport dimensions from './theme/dimensions';\nimport ButtonLayout from './components/layout/ButtonLayout';\nimport ContainerLayout from './components/layout/ContainerLayout';\nimport FrameLayout from './components/layout/FrameLayout';\nimport BigButton from './components/ui/BigButton';\nimport Button from './components/ui/Button';\nimport Canvas from './components/ui/Canvas';\nimport SmallButton from './components/ui/SmallButton';\nimport { ControlKey } from '../core/types/enums';\nimport ControlInputHandler from '../core/helpers/ControlInputHandlerHelper';\nimport Debugger from './Debugger';\nimport SessionModal from './SessionModal';\n// prettier-ignore\n/**\n * Responsible for rendering the game body and handling control events.\n *\n * This class acts as the main view controller, orchestrating the layout,\n * styles, and user interaction (clicks and holds) for the game.\n *\n * @class\n */\nvar GameView = /** @class */ (function () {\n /**\n * Creates an instance of GameView.\n *\n * @param p - The p5 instance used for rendering and event handling.\n * @param parent - The DOM element where the game view will be attached.\n */\n function GameView(p, parent) {\n this._parent = parent;\n this._p = p;\n }\n /**\n * Checks if the game body has been built.\n * @returns True if the game body has been built, false otherwise.\n */\n GameView.prototype.isBodyBuilt = function () {\n return this._cachedCanvas != null;\n };\n /**\n * Builds the visual structure of the game.\n *\n * It initializes themes, layouts (frames, containers, buttons), and calculates responsive dimensions.\n *\n * @returns An object containing the canvas element and its explicit dimensions.\n * - canvas: The p5 element for the canvas.\n * - canvasWidth: The calculated width of the canvas.\n * - canvasHeight: The calculated height of the canvas.\n */\n GameView.prototype.build = function () {\n if (this._cachedCanvas) {\n return this._cachedCanvas;\n }\n applyColors();\n //Container\n var _a = ContainerLayout(this._p, this._parent), container = _a.container, height = _a.height, width = _a.width;\n //Frame\n var frame = FrameLayout(this._p, container);\n //Canvas\n var _b = Canvas(this._p, frame, width), canvas = _b.canvas, canvasHeight = _b.canvasHeight, canvasWidth = _b.canvasWidth;\n //Buttons\n var _c = ButtonLayout(this._p, container), largeButtonContainer = _c.largeButtonContainer, smallButtonContainer = _c.smallButtonContainer, directionHorizontalContainer = _c.directionHorizontalContainer, directionVerticalContainer = _c.directionVerticalContainer;\n //System buttons\n this._onOffBtn = SmallButton(this._p, smallButtonContainer, 'On<br/>Off', true);\n this._startPauseBtn = SmallButton(this._p, smallButtonContainer, 'Start<br/>Pause', false);\n this._soundBtn = SmallButton(this._p, smallButtonContainer, 'Sound', true);\n this._resetBtn = SmallButton(this._p, smallButtonContainer, 'Reset', false);\n this._exitBtn = SmallButton(this._p, smallButtonContainer, 'Exit', true);\n this._enableColorBtn = SmallButton(this._p, smallButtonContainer, 'Enable<br/>Colors', false);\n //Direction buttons\n this._upBtn = Button(this._p, directionVerticalContainer, 'UP');\n this._leftBtn = Button(this._p, directionHorizontalContainer, 'LEFT');\n this._downBtn = Button(this._p, directionVerticalContainer, 'DOWN');\n this._rightBtn = Button(this._p, directionHorizontalContainer, 'RIGHT');\n //Action button\n this._actionBtn = BigButton(this._p, largeButtonContainer, 'Action');\n //Set dimensions\n dimensions(width, height, canvasWidth, canvasHeight);\n //Hide splash screen\n this._hideSplash();\n this._cachedCanvas = { canvas: canvas, canvasWidth: canvasWidth, canvasHeight: canvasHeight };\n return this._cachedCanvas;\n };\n /**\n * Sets up the session modal with the current game modules.\n * @param gameModules - The game modules to be used in the session modal.\n */\n GameView.prototype.setupSessionModal = function () {\n this._sessionModal = new SessionModal(this._p);\n this._sessionModal.setup();\n };\n GameView.prototype.showSessionModal = function (onConfirm, onCancel) {\n this._sessionModal.show(onConfirm, onCancel);\n };\n /**\n * Sets up the debugger with the current game modules.\n * @param gameModules - The game modules to be debugged.\n */\n GameView.prototype.setupDebugger = function (gameModules) {\n this._debugger = new Debugger(gameModules, this._p);\n this._debugger.setup();\n };\n GameView.prototype.updateDebuggerGameModules = function (gameModules) {\n this._debugger.setGameModules(gameModules);\n };\n /**\n * Updates the debugger with the current game state.\n */\n GameView.prototype.updateDebugger = function () {\n this._debugger.update();\n };\n /**\n * Binds game control events to the view buttons.\n *\n * Connects click and hold events from the UI buttons to the game logic controllers.\n *\n * @param control - The control module instance.\n */\n GameView.prototype.bindControls = function (control) {\n this._inputHandler = new ControlInputHandler(control);\n //System buttons\n this._bindButtonEvents(this._onOffBtn, ControlKey.POWER);\n this._bindButtonEvents(this._startPauseBtn, ControlKey.START_PAUSE);\n this._bindButtonEvents(this._soundBtn, ControlKey.SOUND);\n this._bindButtonEvents(this._resetBtn, ControlKey.RESET);\n this._bindButtonEvents(this._exitBtn, ControlKey.EXIT);\n this._bindButtonEvents(this._enableColorBtn, ControlKey.COLOR);\n //Direction buttons\n this._bindButtonEvents(this._upBtn, ControlKey.UP);\n this._bindButtonEvents(this._downBtn, ControlKey.DOWN);\n this._bindButtonEvents(this._rightBtn, ControlKey.RIGHT);\n this._bindButtonEvents(this._leftBtn, ControlKey.LEFT);\n //Action button\n this._bindButtonEvents(this._actionBtn, ControlKey.ACTION);\n };\n /**\n * Unbinds all events from the view buttons.\n *\n * Replaces all event listeners with empty functions to prevent interaction\n * (e.g., when the game is paused or stopped).\n */\n GameView.prototype.unbindControls = function () {\n this._onOffBtn.mousePressed(function () { }).mouseReleased(function () { });\n this._startPauseBtn.mousePressed(function () { }).mouseReleased(function () { });\n this._soundBtn.mousePressed(function () { }).mouseReleased(function () { });\n this._resetBtn.mousePressed(function () { }).mouseReleased(function () { });\n this._exitBtn.mousePressed(function () { }).mouseReleased(function () { });\n this._enableColorBtn.mousePressed(function () { }).mouseReleased(function () { });\n this._upBtn.mousePressed(function () { }).mouseReleased(function () { });\n this._downBtn.mousePressed(function () { }).mouseReleased(function () { });\n this._rightBtn.mousePressed(function () { }).mouseReleased(function () { });\n this._leftBtn.mousePressed(function () { }).mouseReleased(function () { });\n this._actionBtn.mousePressed(function () { }).mouseReleased(function () { });\n };\n /**\n * Helper method to bind press and release events using ControlInputHandler.\n *\n * @param btn - The p5 button element to bind.\n * @param key - The control key to notify.\n */\n GameView.prototype._bindButtonEvents = function (btn, key) {\n var _this = this;\n btn.mousePressed(function () { return _this._inputHandler.handlePress(key); });\n btn.mouseReleased(function () { return _this._inputHandler.handleRelease(key); });\n // Also handle mouseOut as release to prevent stuck keys if cursor leaves button\n btn.mouseOut(function () { return _this._inputHandler.handleRelease(key); });\n };\n /**\n * Helper method to hide the splash screen after a delay.\n *\n * @param delay - The delay in milliseconds (defaults to `configs.viewLayout.splashHideDelayMs`).\n */\n GameView.prototype._hideSplash = function (delay) {\n if (delay === void 0) { delay = configs.viewLayout.splashHideDelayMs; }\n var splash = document.querySelector(configs.selectors.splash);\n setTimeout(function () {\n splash.style.display = 'none';\n }, delay);\n };\n return GameView;\n}());\nexport default GameView;\n","import { colord } from 'colord';\nimport configs from '../../config/configs';\n// prettier-ignore\n/**\n * Applies color themes to the application by setting CSS variables.\n *\n * It checks for `configs.inputQueryParams.mainColor` and `configs.inputQueryParams.buttonColor` query parameters in the URL.\n * If present, these values are used; otherwise, default `configs.colors` are applied.\n * It also calculates and sets shadow and reflection variations for these colors.\n *\n * @returns {void}\n */\nexport default function applyColors() {\n var root = document.querySelector(':root');\n var paramsString = window.location.href.substring(window.location.href.indexOf('?') + 1);\n var searchParams = new URLSearchParams(paramsString);\n var mainColor = searchParams.has(configs.inputQueryParams.mainColor)\n ? searchParams.get(configs.inputQueryParams.mainColor)\n : configs.colors.bodyMain;\n var buttonColor = searchParams.has(configs.inputQueryParams.buttonColor)\n ? searchParams.get(configs.inputQueryParams.buttonColor)\n : configs.colors.bodyButton;\n root.style.setProperty('--main-color', mainColor);\n root.style.setProperty('--button-color', buttonColor);\n root.style.setProperty('--color-shadow', colord(mainColor).darken(0.15).toHex());\n root.style.setProperty('--color-shadow-reflexion', colord(mainColor).lighten(0.15).toHex());\n root.style.setProperty('--button-color-reflexion', colord(buttonColor).lighten(0.15).toHex());\n root.style.setProperty('--button-color-shadow', colord(buttonColor).darken(0.15).toHex());\n}\n","import configs from '../../../config/configs';\n/**\n * Creates the main game container and calculates its optimal dimensions.\n *\n * It ensures the game container fits within the parent element (usually the window or a specific div)\n * while maintaining a fixed aspect ratio defined by `configs.viewLayout.bodyHeightWidthMultiplier`.\n * On smaller screens (<= configs.viewLayout.mobileBreakpoint width), it attempts to fill the parent width.\n * On larger screens, it calculates the maximum dimensions that fit without overflowing vertically.\n *\n * @param {p5} p - The p5 instance.\n * @param {HTMLElement} parent - The DOM element where the container will be appended.\n * @returns {ContainerResponse} Object containing the container element and its calculated width/height.\n */\nexport default function ContainerLayout(p, parent) {\n var container = p.createDiv();\n container.parent(configs.selectors.parent);\n container.id(configs.selectors.viewElementIds.container);\n var width;\n var height;\n if (parent.clientWidth <= configs.viewLayout.mobileBreakpoint) {\n width = parent.clientWidth;\n height = parent.clientHeight;\n return { container: container, width: width, height: height };\n }\n // Calcula a largura máxima baseada na altura disponível\n var maxHeightWidth = parent.clientHeight / (configs.viewLayout.bodyHeightWidthMultiplier * 1.05);\n // A largura final é o menor valor entre a largura disponível e a largura limitada pela altura\n width = Math.min(parent.clientWidth, maxHeightWidth);\n // A altura é calculada com base na proporção original\n height = width * configs.viewLayout.bodyHeightWidthMultiplier;\n return { container: container, width: width, height: height };\n}\n","import configs from '../../../config/configs';\n/**\n * Creates the decorative frame for the game.\n *\n * Adds a visual frame around the game area and includes the branding text \"Brick Game\".\n *\n * @param p - The p5 instance.\n * @param container - The parent container element.\n * @returns The created frame element.\n */\nexport default function FrameLayout(p, container) {\n var frame = p.createDiv();\n frame.parent(container);\n frame.id(configs.selectors.viewElementIds.frame);\n var div = p.createDiv();\n div.parent(frame);\n var paragraph = p.createP('Brick Game');\n paragraph.parent(div);\n return frame;\n}\n","import configs from '../../../config/configs';\n/**\n * Creates the main p5 canvas for rendering the game.\n *\n * It calculates the canvas size based on the provided container width, maintaining a specific aspect ratio\n * defined by `configs.viewLayout.canvas.aspectRatio`.\n *\n * @param {p5} p - The p5 instance.\n * @param {p5.Element} container - The frame container to attach the canvas to.\n * @param {number} width - The width of the outer container, used to calculate canvas dimensions with `configs.viewLayout.canvas.widthRatio`.\n * @returns {CanvasResponse} Object containing the canvas element and its calculated dimensions.\n */\nexport default function Canvas(p, container, width) {\n var canvasWidth = width * configs.viewLayout.canvas.widthRatio;\n var canvasHeight = canvasWidth * configs.viewLayout.canvas.aspectRatio;\n var canvas = p.createCanvas(canvasWidth, canvasHeight);\n canvas.parent(container);\n canvas.id(configs.selectors.viewElementIds.canvas);\n return { canvasWidth: canvasWidth, canvasHeight: canvasHeight, canvas: canvas };\n}\n","import configs from '../../../config/configs';\n/**\n * Creates and organizes the layout containers for game control buttons.\n *\n * It constructs a hierarchy of div elements to separate small system buttons,\n * inner group buttons, and directional pads.\n *\n * @param {p5} p - The p5 instance.\n * @param {p5.Element} container - The parent container element.\n * @returns {ButtonLayoutResponse} Object containing the button containers.\n * - smallButtonContainer: For system buttons (Reset, Sound, etc.), uses `configs.selectors.viewElementIds.smallButtonContainer`.\n * - mediumButtonContainer: For direction controls, uses `configs.selectors.viewElementIds.mediumButtonContainer`.\n * - largeButtonContainer: For the main action button, uses `configs.selectors.viewElementIds.largeButtonContainer`.\n * - directionVerticalContainer: For Up/Down buttons.\n * - directionHorizontalContainer: For Left/Right buttons.\n */\nexport default function ButtonLayout(p, container) {\n var buttonContainer = p.createDiv();\n buttonContainer.parent(container);\n buttonContainer.id(configs.selectors.viewElementIds.buttonContainer);\n var smallButtonContainer = p.createDiv();\n smallButtonContainer.parent(buttonContainer);\n smallButtonContainer.id(configs.selectors.viewElementIds.smallButtonContainer);\n var innerButtonContainer = p.createDiv();\n innerButtonContainer.parent(buttonContainer);\n innerButtonContainer.id(configs.selectors.viewElementIds.innerButtonContainer);\n var mediumButtonContainer = p.createDiv();\n mediumButtonContainer.parent(innerButtonContainer);\n mediumButtonContainer.id(configs.selectors.viewElementIds.mediumButtonContainer);\n var directionVerticalContainer = p.createDiv();\n directionVerticalContainer.parent(mediumButtonContainer);\n directionVerticalContainer.id(configs.selectors.viewElementIds.directionVerticalContainer);\n var directionHorizontalContainer = p.createDiv();\n directionHorizontalContainer.parent(mediumButtonContainer);\n directionHorizontalContainer.id(configs.selectors.viewElementIds.directionHorizontalContainer);\n var largeButtonContainer = p.createDiv();\n largeButtonContainer.parent(innerButtonContainer);\n largeButtonContainer.id(configs.selectors.viewElementIds.largeButtonContainer);\n return {\n smallButtonContainer: smallButtonContainer,\n mediumButtonContainer: mediumButtonContainer,\n largeButtonContainer: largeButtonContainer,\n directionVerticalContainer: directionVerticalContainer,\n directionHorizontalContainer: directionHorizontalContainer,\n };\n}\n","/**\n * Creates the large action button.\n *\n * This button is typically used for the primary game action (e.g., rotate, fire).\n * It creates a specific container and applies large button styles.\n *\n * @param p - The p5 instance.\n * @param container - The container element to attach the button to.\n * @param label - The text label for the button (currently used for aria-label or internal logic as visual label is commented out).\n * @returns The created button element.\n */\nexport default function BigButton(p, container, label) {\n //Container\n var buttonContainer = p.createDiv();\n buttonContainer.parent(container);\n buttonContainer.addClass('lg-btn-container');\n // //Label\n // const paragraph = p.createP(label);\n // paragraph.parent(buttonContainer);\n // paragraph.addClass('lg-btn-p');\n //Button\n var button = p.createButton(label);\n button.parent(buttonContainer);\n button.addClass('lg-btn');\n return button;\n}\n","import configs from '../../config/configs';\n// prettier-ignore\n/**\n * Calculates and sets various CSS variables for responsive sizing of the game UI.\n *\n * This function defines sizes for the main container, canvas, borders, buttons (including mobile variations),\n * and fonts based on the provided dimensions.\n *\n * @param width - The width of the game container.\n * @param height - The height of the game container.\n * @param canvasWidth - The width of the game canvas.\n * @param canvasHeight - The height of the game canvas.\n * @returns\n */\nexport default function dimensions(width, height, canvasWidth, canvasHeight) {\n var root = document.querySelector(':root');\n root.style.setProperty('--dispersion', configs.viewLayout.shadowDispersion);\n root.style.setProperty('--width', \"\".concat(width, \"px\"));\n root.style.setProperty('--height', \"\".concat(height, \"px\"));\n root.style.setProperty('--canvas-width', \"\".concat(canvasWidth, \"px\"));\n root.style.setProperty('--canvas-height', \"\".concat(canvasHeight, \"px\"));\n root.style.setProperty('--border-radius', \"\".concat(width * configs.viewLayout.dimensions.borderRadiusRatio, \"px\"));\n root.style.setProperty('--border', \"\".concat(width * configs.viewLayout.dimensions.borderWidthRatio, \"px solid black\"));\n root.style.setProperty('--sm-button-size', \"\".concat(width * configs.viewLayout.dimensions.button.smSizeRatio, \"px\"));\n root.style.setProperty('--button-size', \"\".concat(width * configs.viewLayout.dimensions.button.mdSizeRatio, \"px\"));\n root.style.setProperty('--lg-button-size', \"\".concat(width * configs.viewLayout.dimensions.button.lgSizeRatio, \"px\"));\n root.style.setProperty('--sm-button-size-mobile', \"\".concat(width * configs.viewLayout.dimensions.button.mobile.smSizeRatio, \"px\"));\n root.style.setProperty('--button-size-mobile', \"\".concat(width * configs.viewLayout.dimensions.button.mobile.mdSizeRatio, \"px\"));\n root.style.setProperty('--lg-button-size-mobile', \"\".concat(width * configs.viewLayout.dimensions.button.mobile.lgSizeRatio, \"px\"));\n root.style.setProperty('--sm-button-size-mobile-font-size', \"\".concat(width * configs.viewLayout.dimensions.button.mobile.smFontRatio, \"px\"));\n root.style.setProperty('--sm-button-size-mobile-line-height', \"\".concat(width * configs.viewLayout.dimensions.button.mobile.smFontRatio, \"px\"));\n root.style.setProperty('--button-size-mobile-font-size', \"\".concat(width * configs.viewLayout.dimensions.button.mobile.fontRatio, \"px\"));\n root.style.setProperty('--lg-button-size-mobile-font-size', \"\".concat(width * configs.viewLayout.dimensions.button.mobile.lgFontRatio, \"px\"));\n root.style.setProperty('--button-size-mobile-spacing', \"\".concat(width * configs.viewLayout.dimensions.button.mobile.spacingRatio, \"px\"));\n root.style.setProperty('--button-border', \"\".concat(width * configs.viewLayout.dimensions.button.borderRatio, \"px solid black\"));\n root.style.setProperty('--button-animation-duration', configs.viewLayout.dimensions.button.animationDuration);\n}\n"],"names":["root","factory","exports","module","define","amd","self","Color","FontAlign","FontSize","FontVerticalAlign","Sound","ControlKey","ControlEventType","StateProperty","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","colors","background","active","inactive","bodyMain","bodyButton","screenLayout","grid","columns","rows","hudGrid","display","width","height","margin","borderWeight","fontSize","extraSmall","small","medium","large","extraLarge","cell","padding","strokeWeight","viewLayout","bodyHeightWidthMultiplier","mobileBreakpoint","canvas","widthRatio","aspectRatio","splashHideDelayMs","dimensions","borderRadiusRatio","borderWidthRatio","button","smSizeRatio","mdSizeRatio","lgSizeRatio","mobile","fontRatio","smFontRatio","lgFontRatio","spacingRatio","borderRatio","animationDuration","shadowDispersion","inputQueryParams","mainColor","buttonColor","runningOnApp","selectors","parent","splash","modalIds","sessionModal","sessionContinueYes","sessionContinueNo","viewElementIds","container","frame","buttonContainer","smallButtonContainer","innerButtonContainer","mediumButtonContainer","directionVerticalContainer","directionHorizontalContainer","largeButtonContainer","storageKeys","muted","colorEnabled","tickInterval","score","buttonHold","holdDelayMs","holdIntervalMs","game","minTickInterval","debugger","msInterval","enabled","sound","volume","ControlInputHandlerHelper","control","this","_activeKeys","Map","_control","handlePress","_this","has","notify","PRESSED","delayTimer","setTimeout","holdTimer","setInterval","HELD","configs","timers","hold","set","delay","handleRelease","clearTimeout","clearInterval","delete","DEFAULT_KEY_MAP","ArrowUp","UP","ArrowDown","DOWN","ArrowLeft","LEFT","ArrowRight","RIGHT","KeyW","KeyS","KeyA","KeyD","KeyJ","ACTION","Digit1","POWER","Digit2","START_PAUSE","Digit3","SOUND","Digit4","RESET","Digit5","EXIT","Digit6","COLOR","GameControlKeyBinding","_inputHandler","_boundHandleKeyDown","_handleKeyDown","bind","_boundHandleKeyUp","_handleKeyUp","bindControls","window","addEventListener","unbindControls","removeEventListener","event","controlKey","code","repeat","GameControl","_subscribers","setup","_keyBinding","clear","setModules","modules","_modules","subscribe","type","callback","keySubscribers","Set","add","unsubscribe","callbacks","_a","Error","state","isAllowed","isOff","isStarted","isPlaying","isGameOver","isPaused","endsWith","forEach","getDebugData","totalSubscribers","keyMap","typeSet","size","total_subscribers","tracked_keys","CellHelper","emptyCell","coordinate","color","DEFAULT","__assign","assign","t","s","i","n","arguments","length","p","apply","GridMovementEngine","movePiece","piece","direction","newPiece","map","x","y","isInvalid","some","isValidCoordinate","isCellActive","coord","c","movePieceLeft","movePieceRight","movePieceUp","movePieceDown","moveCell","newCoord","moveCellLeft","moveCellRight","moveCellUp","moveCellDown","getDropPath","currentPiece","nextPiece","getRisePath","getReachPathLeft","getReachPathRight","GridTransformEngine","rotatePiece","origin","clockwise","relX","relY","newRelX","newRelY","mirrorPiece","axis","bounds","getPieceBounds","center","min","max","Math","round","xs","ys","GridAnalysisEngine","getFullRows","fullRows","isFull","push","getFullColumns","fullColumns","getNeighbors","includeDiagonal","neighbors","offsets","offset","neighborCoord","getCell","findConnectedCells","targetValue","connected","visited","queue","getCoordKey","concat","current","shift","swapCells","a","b","cellA","cellB","stampCell","GridLineEngine","isRowFull","gridData","getGrid","every","isRowEmpty","clearRow","shiftRowsDown","fromY","prevCell","shiftRowsUp","nextCell","clearFullRows","rowsCleared","isColumnFull","isColumnEmpty","clearColumn","shiftColumnsRight","fromX","shiftColumnsLeft","clearFullColumns","columnsCleared","GridRegionEngine","isAreaOccupied","coordinates","fillArea","start","end","xMin","xMax","yMin","yMax","setCellValue","setCellColor","stampPiece","GameGrid","_grid","serialId","_movementEngine","_transformEngine","_analysisEngine","_lineEngine","_regionEngine","configurable","resetGrid","isCellInactive","activeCells","flat","filter","serialize","console","log","JSON","stringify","deserialize","data","parsed","parse","RelativeValuesHelper","getRelativeWidth","getRelativeHeight","DisplayRenderer","_p","rendererMetrics","_rendererMetrics","cellMargin","cellPadding","cellStrokeWeight","cellSize","_cellPreCalculatedGeometry","innerOffset","innerSize","paddingOffset","paddingSize","_renderStaticElements","render","image","_staticGraphics","renderGrid","pop","createGraphics","noFill","stroke","rect","renderCell","_b","INACTIVE","isColorEnabled","translate","fill","row","CoordinateHelper","getRelativeCoordinate","getDisplayPosX","displayWidth","getDisplayPosY","displayHeight","getHudPosX","zero","getHudPosY","HudRenderer","_cellSize","_gridOrigin","_hudBorderRect","w","h","_renderHud","_drawHudGrid","text","setTextSize","SMALL","setInactiveText","setTextAlign","BOTTOM","textOnHud","isOn","setActiveText","toString","highScore","levelValue","level","maxLevel","CENTER","isMuted","drawCellElement","posX","posY","GameRenderer","addRenderer","renderer","_renderers","_displayRenderer","_hudRenderer","_calculateMetrics","displayMargin","gridColumns","displayOrigin","hudOrigin","hudWidth","hudHeight","hud","display_width","toFixed","display_height","hud_width","hud_height","cell_size","STATE_CONFIG","ON","defaultValue","START","PLAYING","GAME_OVER","COLOR_ENABLED","storageKey","MUTED","GameState","_state","values","property","config","_loadPersistentState","storedValue","localStorage","getItem","_set","setItem","_notify","turnOn","turnOff","startGame","resetGameOver","exitGame","pause","resume","triggerGameOver","resetGame","setColorEnabled","setMuted","toggleColorEnabled","toggleMuted","cb","on","playing","paused","game_over","color_enabled","GameText","defaultFontFamily","fontSizes","textFont","EXTRA_SMALL","MEDIUM","LARGE","EXTRA_LARGE","setRendererMetrics","setTextState","textSize","fontAlign","fontVerticalAlign","textAlign","textOnDisplay","current_font_family","font_sizes_count","GameTime","_accumulatedTime","_initialTickInterval","_minTickInterval","_tickInterval","_fps","_tps","_tickCounter","_timeSinceLastTpsUpdate","reset","update","deltaTime","shouldTick","interval","incrementTickInterval","amount","decrementTickInterval","newInterval","fps","tps","tick_interval","accumulated_time","setTickInterval","setMinTickInterval","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","e","rejected","result","done","then","__generator","body","f","_","label","sent","trys","ops","g","create","Iterator","verb","iterator","v","op","TypeError","GameSound","_buffers","_activeSources","_volume","AudioContextClass","AudioContext","webkitAudioContext","_audioContext","latencyHint","_gainNode","createGain","connect","destination","_updateGain","_loadAll","play","buffer","source","sources","createBufferSource","onended","index","indexOf","splice","warn","stop","stopAll","activeSounds","_i","activeSounds_1","Array","from","keys","gain","setValueAtTime","currentTime","loadPromises","soundUrl","arrayBuffer","audioBuffer","error_1","fetch","decodeAudioData","error","all","toggleMute","syncState","activeSourcesCount","active_sources","loaded_buffers","GameScore","_score","_multiplier","_level","_maxLevel","_highScore","Number","increaseScore","resetScore","getFormattedScore","digits","padStart","increaseLevel","resetLevel","multiplier","max_level","extendStatics","__extends","d","setPrototypeOf","__proto__","String","__","constructor","_super","GameHudGrid","InterfaceIdentifierHelper","isSerializable","serializable","hasSerialize","hasDeserialize","hasSerialId","isInitializable","isStateSyncable","stateSyncable","isDebuggable","InitialStateSnapshot","_initialState","_baseProperties","captureBaseProperties","instance","captureInitialState","entries","includes","initialValue","structuredClone","restoreInitialState","GameSession","_isModalClosed","_serializables","register","saveSession","_isGameMenuInstance","_key","clearSession","removeItem","setShowModalFunction","showModal","_showSessionModal","gameId","_hasSession","_loadSession","_destroySession","serializables","join","Game","view","undefined","_initialStateSnapshot","_gameId","_switchHandler","_view","id","setSwitchHandler","handler","propagateSwitchHandler","switchGame","newGame","destroy","build","time","session","showSessionModal","setupGame","_subscribeSystemControls","draw","drawTitleScreen","drawGameOverScreen","noLoop","r","grad","turn","rad","PI","pow","u","isFinite","floor","l","m","string","exec","parseInt","substr","object","N","M","H","$","j","trim","rgba","isValid","brightness","isDark","isLight","toHex","toRgb","toRgbString","toHsl","toHslString","toHsv","invert","saturate","desaturate","grayscale","lighten","darken","rotate","hue","alpha","isEqual","Button","createDiv","addClass","createButton","SmallButton","top","paragraph","createP","NewDebugger","gameModules","_moduleElements","_gameModules","existingDetails","select","wasOpen","elt","hasAttribute","openModules","selectAll","remove","details","createElement","attribute","summary","html","name","moduleProperty_1","properties","moduleDetails_1","class","moduleSummary","moduleData","dataElement","mouseClicked","toggleClass","dataKeyElement","dataValueElement","element","setGameModules","moduleProperty","SessionModal","_container","modal","title","screen","screenText","buttonsContainer","_cancelButton","_confirmButton","show","onConfirm","onCancel","mousePressed","_hide","removeClass","GameView","_parent","isBodyBuilt","_cachedCanvas","paramsString","searchParams","document","querySelector","location","href","substring","URLSearchParams","style","setProperty","clientWidth","clientHeight","maxHeightWidth","ContainerLayout","div","FrameLayout","canvasWidth","canvasHeight","createCanvas","Canvas","_c","ButtonLayout","_onOffBtn","_startPauseBtn","_soundBtn","_resetBtn","_exitBtn","_enableColorBtn","_upBtn","_leftBtn","_downBtn","_rightBtn","_actionBtn","BigButton","_hideSplash","setupSessionModal","_sessionModal","setupDebugger","_debugger","Debugger","updateDebuggerGameModules","updateDebugger","_bindButtonEvents","mouseReleased","btn","mouseOut"],"sourceRoot":""}
|