├── .gitattributes ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── assets ├── data │ └── story.json └── images │ ├── buttons │ └── next.png │ └── story │ ├── 0.png │ ├── 1.png │ ├── 10.png │ ├── 11.png │ ├── 12.png │ ├── 13.png │ ├── 14.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ ├── 5.png │ ├── 6.png │ ├── 7.png │ ├── 8.png │ └── 9.png ├── docs ├── assets │ ├── AssetManifest.json │ ├── FontManifest.json │ ├── NOTICES │ ├── assets │ │ ├── data │ │ │ └── story.json │ │ └── images │ │ │ ├── buttons │ │ │ └── next.png │ │ │ └── story │ │ │ ├── 0.png │ │ │ ├── 1.png │ │ │ ├── 10.png │ │ │ ├── 11.png │ │ │ ├── 12.png │ │ │ ├── 13.png │ │ │ ├── 14.png │ │ │ ├── 2.png │ │ │ ├── 3.png │ │ │ ├── 4.png │ │ │ ├── 5.png │ │ │ ├── 6.png │ │ │ ├── 7.png │ │ │ ├── 8.png │ │ │ └── 9.png │ └── fonts │ │ └── MaterialIcons-Regular.otf ├── canvaskit │ ├── canvaskit.js │ ├── canvaskit.wasm │ └── profiling │ │ ├── canvaskit.js │ │ └── canvaskit.wasm ├── favicon.png ├── flutter.js ├── flutter_service_worker.js ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── images │ └── brainpunk.png ├── index.html ├── main.dart.js ├── manifest.json └── version.json ├── lib └── main.dart ├── pubspec.lock ├── pubspec.yaml └── web ├── favicon.png ├── icons ├── Icon-192.png ├── Icon-512.png ├── Icon-maskable-192.png └── Icon-maskable-512.png ├── images └── brainpunk.png ├── index.html └── manifest.json /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Web related 36 | lib/generated_plugin_registrant.dart 37 | 38 | # Symbolication related 39 | app.*.symbols 40 | 41 | # Obfuscation related 42 | app.*.map.json 43 | 44 | # Android Studio will place build artifacts here 45 | /android/app/debug 46 | /android/app/profile 47 | /android/app/release 48 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: f1875d570e39de09040c8f79aa13cc56baab8db1 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 17 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 18 | - platform: android 19 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 20 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 21 | - platform: ios 22 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 23 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 24 | - platform: linux 25 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 26 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 27 | - platform: macos 28 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 29 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 30 | - platform: web 31 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 32 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 33 | - platform: windows 34 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 35 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # brain_punk 2 | 3 | For details visit https://ankitmahato.itch.io/brain-punk 4 | To play visit https://animator.github.io/brain_punk 5 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /assets/data/story.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "id": 0, 5 | "q": "Hi! I am Elyssa and I am a Reck. During the day I work in Cafe-147 selling bread to other Recks to provide for my little brother Adam.", 6 | "a": null 7 | }, 8 | { 9 | "id": 1, 10 | "q": "At night, I pursue my hobby of building my mini mechadroid, which is cool but not Artificially Intelligent as the real mechadroids that rule our world.", 11 | "a": null 12 | }, 13 | { 14 | "id": 2, 15 | "q": "I just finished my shift and returned home to find my little brother missing. The front door was smashed open and there was something odd lying on the floor ..", 16 | "a": null 17 | }, 18 | { 19 | "id": 3, 20 | "q": "A bottle of filled single malt left in hurry. Maybe by the Reck who has my brother. I am worried and this is my only clue. Help me calculate its weight if it is 1 KG plus half its own weight?", 21 | "a": "2" 22 | }, 23 | { 24 | "id": 4, 25 | "q": "Well done! There is only one place which sells this brand in Zone-12G - THE SHINAGAWA HIGHBALL BAR. The Reck guarding the gate collected cigarette butts thrown by other customers. He was a low earning Reck like me and used the leftover tobacco in these discarded butts to roll his own cigarette. For every 8 cigarette butts he collected, he rolled 1 full cigarette for himself. He told me that he would let me enter if I answered one simple question. How many cigarettes can he make from 64 collected butts?", 26 | "a": "9" 27 | }, 28 | { 29 | "id": 5, 30 | "q": "I went straight to the bar-droid. They are much reliable than other Recks when you need information. The deal was simple, I had to solve this ancient glyph which the droid was struggling with in exchange for the whereabouts of my brother.", 31 | "a": null 32 | }, 33 | { 34 | "id": 6, 35 | "q": "I had never seen anything like this before, maybe the symbols represent numbers. The key was to find the three numbers at the bottom, but in order to do so I need to work out what numbers do these symbols represent. Each row and column adds up to a number, shown as another symbol at the end of each row or column. Hurry up now! enter the 3 digit answer -", 36 | "a": "312" 37 | }, 38 | { 39 | "id": 7, 40 | "q": "The bar-droid told me the location of the kidnapper, but I cannot go unarmed so I went to meet an Explochemist.", 41 | "a": null 42 | }, 43 | { 44 | "id": 8, 45 | "q": "The Explochemist had arranged different explosive liquids in such a way that each shelf held a total of 9 liters, contained in three types of jars - small, medium and large. The large jar contained more than thrice the quantity of the medium jar. The required explosive was in the top large jar. Can you tell me its capacity?", 46 | "a": "4" 47 | }, 48 | { 49 | "id": 9, 50 | "q": "I sneaked into the mob's den. He had ransomed two captive Recks (none of which was my brother) for 210 git-coins. On one Reck he made a profit of 10% over the cost he paid his henchmen to kidnap, and on the other he made a loss of 10%. Overall he made a profit of 5%. How much did he pay his henchmen for the profitable Reck?", 51 | "a": "150" 52 | }, 53 | { 54 | "id": 10, 55 | "q": "Is my brother safe. I still had no clue. With tears in my eyes, I saw something, there was still hope. I decided to breach the AI Tower - the tallest skyscraper that took seven years to build. It was the brain of this city and might have the answer. While under construction, each year the recks were able to double its height. Can you tell me how many years did it take for the skyscraper to reach half of its maximum height?", 56 | "a": "6" 57 | }, 58 | { 59 | "id": 11, 60 | "q": "I saw an unattended bike, grabbed it and rushed. Its odometer read 15951 - a pallindrome. 2 hours later I reached the tower, the odometer showed another pallindrome. How fast was I driving?", 61 | "a": "55" 62 | }, 63 | { 64 | "id": 12, 65 | "q": "The tower was heavily guarded, but I sneaked my way into the alpha lift. A star pad to activate, that's new!", 66 | "a": null 67 | }, 68 | { 69 | "id": 13, 70 | "q": "Strangely, the buttons were the 12 nodes of a six pointed star. I figured out that each button needed a unique number of presses from 1 to 12. The sum of button presses required for each of the six rows was 26. Can you tell me the sum of button presses required by 6 outer points of the star?", 71 | "a": "24" 72 | }, 73 | { 74 | "id": null, 75 | "q": "The elevator door opened. I could see my brother smiling, eagerly waiting for me. Without wasting any further time I ran and hugged him. 'Congratulations for passing our Test!'- someone said in a heavy voice. I turned and I was greeted by a mechlord. Want to know what happened next - Star this game on github!", 76 | "a": null 77 | } 78 | ] 79 | } -------------------------------------------------------------------------------- /assets/images/buttons/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/assets/images/buttons/next.png -------------------------------------------------------------------------------- /assets/images/story/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/assets/images/story/0.png -------------------------------------------------------------------------------- /assets/images/story/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/assets/images/story/1.png -------------------------------------------------------------------------------- /assets/images/story/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/assets/images/story/10.png -------------------------------------------------------------------------------- /assets/images/story/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/assets/images/story/11.png -------------------------------------------------------------------------------- /assets/images/story/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/assets/images/story/12.png -------------------------------------------------------------------------------- /assets/images/story/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/assets/images/story/13.png -------------------------------------------------------------------------------- /assets/images/story/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/assets/images/story/14.png -------------------------------------------------------------------------------- /assets/images/story/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/assets/images/story/2.png -------------------------------------------------------------------------------- /assets/images/story/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/assets/images/story/3.png -------------------------------------------------------------------------------- /assets/images/story/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/assets/images/story/4.png -------------------------------------------------------------------------------- /assets/images/story/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/assets/images/story/5.png -------------------------------------------------------------------------------- /assets/images/story/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/assets/images/story/6.png -------------------------------------------------------------------------------- /assets/images/story/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/assets/images/story/7.png -------------------------------------------------------------------------------- /assets/images/story/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/assets/images/story/8.png -------------------------------------------------------------------------------- /assets/images/story/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/assets/images/story/9.png -------------------------------------------------------------------------------- /docs/assets/AssetManifest.json: -------------------------------------------------------------------------------- 1 | {"assets/data/story.json":["assets/data/story.json"],"assets/images/buttons/next.png":["assets/images/buttons/next.png"],"assets/images/story/.DS_Store":["assets/images/story/.DS_Store"],"assets/images/story/0.png":["assets/images/story/0.png"],"assets/images/story/1.png":["assets/images/story/1.png"],"assets/images/story/10.png":["assets/images/story/10.png"],"assets/images/story/11.png":["assets/images/story/11.png"],"assets/images/story/12.png":["assets/images/story/12.png"],"assets/images/story/13.png":["assets/images/story/13.png"],"assets/images/story/14.png":["assets/images/story/14.png"],"assets/images/story/2.png":["assets/images/story/2.png"],"assets/images/story/3.png":["assets/images/story/3.png"],"assets/images/story/4.png":["assets/images/story/4.png"],"assets/images/story/5.png":["assets/images/story/5.png"],"assets/images/story/6.png":["assets/images/story/6.png"],"assets/images/story/7.png":["assets/images/story/7.png"],"assets/images/story/8.png":["assets/images/story/8.png"],"assets/images/story/9.png":["assets/images/story/9.png"]} -------------------------------------------------------------------------------- /docs/assets/FontManifest.json: -------------------------------------------------------------------------------- 1 | [{"family":"MaterialIcons","fonts":[{"asset":"fonts/MaterialIcons-Regular.otf"}]}] -------------------------------------------------------------------------------- /docs/assets/assets/data/story.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "id": 0, 5 | "q": "Hi! I am Elyssa and I am a Reck. During the day I work in Cafe-147 selling bread to other Recks to provide for my little brother Adam.", 6 | "a": null 7 | }, 8 | { 9 | "id": 1, 10 | "q": "At night, I pursue my hobby of building my mini mechadroid, which is cool but not Artificially Intelligent as the real mechadroids that rule our world.", 11 | "a": null 12 | }, 13 | { 14 | "id": 2, 15 | "q": "I just finished my shift and returned home to find my little brother missing. The front door was smashed open and there was something odd lying on the floor ..", 16 | "a": null 17 | }, 18 | { 19 | "id": 3, 20 | "q": "A bottle of filled single malt left in hurry. Maybe by the Reck who has my brother. I am worried and this is my only clue. Help me calculate its weight if it is 1 KG plus half its own weight?", 21 | "a": "2" 22 | }, 23 | { 24 | "id": 4, 25 | "q": "Well done! There is only one place which sells this brand in Zone-12G - THE SHINAGAWA HIGHBALL BAR. The Reck guarding the gate collected cigarette butts thrown by other customers. He was a low earning Reck like me and used the leftover tobacco in these discarded butts to roll his own cigarette. For every 8 cigarette butts he collected, he rolled 1 full cigarette for himself. He told me that he would let me enter if I answered one simple question. How many cigarettes can he make from 64 collected butts?", 26 | "a": "9" 27 | }, 28 | { 29 | "id": 5, 30 | "q": "I went straight to the bar-droid. They are much reliable than other Recks when you need information. The deal was simple, I had to solve this ancient glyph which the droid was struggling with in exchange for the whereabouts of my brother.", 31 | "a": null 32 | }, 33 | { 34 | "id": 6, 35 | "q": "I had never seen anything like this before, maybe the symbols represent numbers. The key was to find the three numbers at the bottom, but in order to do so I need to work out what numbers do these symbols represent. Each row and column adds up to a number, shown as another symbol at the end of each row or column. Hurry up now! enter the 3 digit answer -", 36 | "a": "312" 37 | }, 38 | { 39 | "id": 7, 40 | "q": "The bar-droid told me the location of the kidnapper, but I cannot go unarmed so I went to meet an Explochemist.", 41 | "a": null 42 | }, 43 | { 44 | "id": 8, 45 | "q": "The Explochemist had arranged different explosive liquids in such a way that each shelf held a total of 9 liters, contained in three types of jars - small, medium and large. The large jar contained more than thrice the quantity of the medium jar. The required explosive was in the top large jar. Can you tell me its capacity?", 46 | "a": "4" 47 | }, 48 | { 49 | "id": 9, 50 | "q": "I sneaked into the mob's den. He had ransomed two captive Recks (none of which was my brother) for 210 git-coins. On one Reck he made a profit of 10% over the cost he paid his henchmen to kidnap, and on the other he made a loss of 10%. Overall he made a profit of 5%. How much did he pay his henchmen for the profitable Reck?", 51 | "a": "150" 52 | }, 53 | { 54 | "id": 10, 55 | "q": "Is my brother safe. I still had no clue. With tears in my eyes, I saw something, there was still hope. I decided to breach the AI Tower - the tallest skyscraper that took seven years to build. It was the brain of this city and might have the answer. While under construction, each year the recks were able to double its height. Can you tell me how many years did it take for the skyscraper to reach half of its maximum height?", 56 | "a": "6" 57 | }, 58 | { 59 | "id": 11, 60 | "q": "I saw an unattended bike, grabbed it and rushed. Its odometer read 15951 - a pallindrome. 2 hours later I reached the tower, the odometer showed another pallindrome. How fast was I driving?", 61 | "a": "55" 62 | }, 63 | { 64 | "id": 12, 65 | "q": "The tower was heavily guarded, but I sneaked my way into the alpha lift. A star pad to activate, that's new!", 66 | "a": null 67 | }, 68 | { 69 | "id": 13, 70 | "q": "Strangely, the buttons were the 12 nodes of a six pointed star. I figured out that each button needed a unique number of presses from 1 to 12. The sum of button presses required for each of the six rows was 26. Can you tell me the sum of button presses required by 6 outer points of the star?", 71 | "a": "24" 72 | }, 73 | { 74 | "id": null, 75 | "q": "The elevator door opened. I could see my brother smiling, eagerly waiting for me. Without wasting any further time I ran and hugged him. 'Congratulations for passing our Test!'- someone said in a heavy voice. I turned and I was greeted by a mechlord. Want to know what happened next - Star this game on github!", 76 | "a": null 77 | } 78 | ] 79 | } -------------------------------------------------------------------------------- /docs/assets/assets/images/buttons/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/assets/images/buttons/next.png -------------------------------------------------------------------------------- /docs/assets/assets/images/story/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/assets/images/story/0.png -------------------------------------------------------------------------------- /docs/assets/assets/images/story/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/assets/images/story/1.png -------------------------------------------------------------------------------- /docs/assets/assets/images/story/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/assets/images/story/10.png -------------------------------------------------------------------------------- /docs/assets/assets/images/story/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/assets/images/story/11.png -------------------------------------------------------------------------------- /docs/assets/assets/images/story/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/assets/images/story/12.png -------------------------------------------------------------------------------- /docs/assets/assets/images/story/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/assets/images/story/13.png -------------------------------------------------------------------------------- /docs/assets/assets/images/story/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/assets/images/story/14.png -------------------------------------------------------------------------------- /docs/assets/assets/images/story/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/assets/images/story/2.png -------------------------------------------------------------------------------- /docs/assets/assets/images/story/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/assets/images/story/3.png -------------------------------------------------------------------------------- /docs/assets/assets/images/story/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/assets/images/story/4.png -------------------------------------------------------------------------------- /docs/assets/assets/images/story/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/assets/images/story/5.png -------------------------------------------------------------------------------- /docs/assets/assets/images/story/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/assets/images/story/6.png -------------------------------------------------------------------------------- /docs/assets/assets/images/story/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/assets/images/story/7.png -------------------------------------------------------------------------------- /docs/assets/assets/images/story/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/assets/images/story/8.png -------------------------------------------------------------------------------- /docs/assets/assets/images/story/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/assets/images/story/9.png -------------------------------------------------------------------------------- /docs/assets/fonts/MaterialIcons-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/docs/assets/fonts/MaterialIcons-Regular.otf -------------------------------------------------------------------------------- /docs/canvaskit/canvaskit.js: -------------------------------------------------------------------------------- 1 | 2 | var CanvasKitInit = (() => { 3 | var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; 4 | if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; 5 | return ( 6 | function(CanvasKitInit) { 7 | CanvasKitInit = CanvasKitInit || {}; 8 | 9 | 10 | null;var t;t||(t=typeof CanvasKitInit !== 'undefined' ? CanvasKitInit : {});var da=Object.assign,fa,ha;t.ready=new Promise(function(a,b){fa=a;ha=b}); 11 | (function(a){a.Vd=a.Vd||[];a.Vd.push(function(){a.MakeSWCanvasSurface=function(b){var c=b;if("CANVAS"!==c.tagName&&(c=document.getElementById(b),!c))throw"Canvas with id "+b+" was not found";if(b=a.MakeSurface(c.width,c.height))b.Nd=c;return b};a.MakeCanvasSurface||(a.MakeCanvasSurface=a.MakeSWCanvasSurface);a.MakeSurface=function(b,c){var f={width:b,height:c,colorType:a.ColorType.RGBA_8888,alphaType:a.AlphaType.Unpremul,colorSpace:a.ColorSpace.SRGB},h=b*c*4,l=a._malloc(h);if(f=a.Surface._makeRasterDirect(f, 12 | l,4*b))f.Nd=null,f.Cf=b,f.zf=c,f.Bf=h,f.bf=l,f.getCanvas().clear(a.TRANSPARENT);return f};a.MakeRasterDirectSurface=function(b,c,f){return a.Surface._makeRasterDirect(b,c.byteOffset,f)};a.Surface.prototype.flush=function(b){a.Od(this.Md);this._flush();if(this.Nd){var c=new Uint8ClampedArray(a.HEAPU8.buffer,this.bf,this.Bf);c=new ImageData(c,this.Cf,this.zf);b?this.Nd.getContext("2d").putImageData(c,0,0,b[0],b[1],b[2]-b[0],b[3]-b[1]):this.Nd.getContext("2d").putImageData(c,0,0)}};a.Surface.prototype.dispose= 13 | function(){this.bf&&a._free(this.bf);this.delete()};a.Od=a.Od||function(){}})})(t); 14 | (function(a){a.Vd=a.Vd||[];a.Vd.push(function(){function b(l,n,q){return l&&l.hasOwnProperty(n)?l[n]:q}function c(l){var n=ka(la);la[n]=l;return n}function f(l){return l.naturalHeight||l.videoHeight||l.displayHeight||l.height}function h(l){return l.naturalWidth||l.videoWidth||l.displayWidth||l.width}a.GetWebGLContext=function(l,n){if(!l)throw"null canvas passed into makeWebGLContext";var q={alpha:b(n,"alpha",1),depth:b(n,"depth",1),stencil:b(n,"stencil",8),antialias:b(n,"antialias",0),premultipliedAlpha:b(n, 15 | "premultipliedAlpha",1),preserveDrawingBuffer:b(n,"preserveDrawingBuffer",0),preferLowPowerToHighPerformance:b(n,"preferLowPowerToHighPerformance",0),failIfMajorPerformanceCaveat:b(n,"failIfMajorPerformanceCaveat",0),enableExtensionsByDefault:b(n,"enableExtensionsByDefault",1),explicitSwapControl:b(n,"explicitSwapControl",0),renderViaOffscreenBackBuffer:b(n,"renderViaOffscreenBackBuffer",0)};q.majorVersion=n&&n.majorVersion?n.majorVersion:"undefined"!==typeof WebGL2RenderingContext?2:1;if(q.explicitSwapControl)throw"explicitSwapControl is not supported"; 16 | l=ma(l,q);if(!l)return 0;na(l);return l};a.deleteContext=function(l){v===qa[l]&&(v=null);"object"===typeof JSEvents&&JSEvents.Hg(qa[l].je.canvas);qa[l]&&qa[l].je.canvas&&(qa[l].je.canvas.yf=void 0);qa[l]=null};a._setTextureCleanup({deleteTexture:function(l,n){var q=la[n];q&&qa[l].je.deleteTexture(q);la[n]=null}});a.MakeGrContext=function(l){if(!this.Od(l))return null;var n=this._MakeGrContext();if(!n)return null;n.Md=l;return n};a.MakeOnScreenGLSurface=function(l,n,q,w){if(!this.Od(l.Md))return null; 17 | n=this._MakeOnScreenGLSurface(l,n,q,w);if(!n)return null;n.Md=l.Md;return n};a.MakeRenderTarget=function(){var l=arguments[0];if(!this.Od(l.Md))return null;if(3===arguments.length){var n=this._MakeRenderTargetWH(l,arguments[1],arguments[2]);if(!n)return null}else if(2===arguments.length){if(n=this._MakeRenderTargetII(l,arguments[1]),!n)return null}else return null;n.Md=l.Md;return n};a.MakeWebGLCanvasSurface=function(l,n,q){n=n||null;var w=l,x="undefined"!==typeof OffscreenCanvas&&w instanceof OffscreenCanvas; 18 | if(!("undefined"!==typeof HTMLCanvasElement&&w instanceof HTMLCanvasElement||x||(w=document.getElementById(l),w)))throw"Canvas with id "+l+" was not found";l=this.GetWebGLContext(w,q);if(!l||0>l)throw"failed to create webgl context: err "+l;l=this.MakeGrContext(l);n=this.MakeOnScreenGLSurface(l,w.width,w.height,n);return n?n:(n=w.cloneNode(!0),w.parentNode.replaceChild(n,w),n.classList.add("ck-replaced"),a.MakeSWCanvasSurface(n))};a.MakeCanvasSurface=a.MakeWebGLCanvasSurface;a.Surface.prototype.makeImageFromTexture= 19 | function(l,n){a.Od(this.Md);l=c(l);if(n=this._makeImageFromTexture(this.Md,l,n))n.Ke=l;return n};a.Surface.prototype.makeImageFromTextureSource=function(l,n){n||(n={height:f(l),width:h(l),colorType:a.ColorType.RGBA_8888,alphaType:a.AlphaType.Unpremul});n.colorSpace||(n.colorSpace=a.ColorSpace.SRGB);a.Od(this.Md);var q=v.je,w=q.createTexture();q.bindTexture(q.TEXTURE_2D,w);2===v.version?q.texImage2D(q.TEXTURE_2D,0,q.RGBA,n.width,n.height,0,q.RGBA,q.UNSIGNED_BYTE,l):q.texImage2D(q.TEXTURE_2D,0,q.RGBA, 20 | q.RGBA,q.UNSIGNED_BYTE,l);q.bindTexture(q.TEXTURE_2D,null);return this.makeImageFromTexture(w,n)};a.Surface.prototype.updateTextureFromSource=function(l,n){if(l.Ke){a.Od(this.Md);var q=v.je,w=la[l.Ke];q.bindTexture(q.TEXTURE_2D,w);2===v.version?q.texImage2D(q.TEXTURE_2D,0,q.RGBA,h(n),f(n),0,q.RGBA,q.UNSIGNED_BYTE,n):q.texImage2D(q.TEXTURE_2D,0,q.RGBA,q.RGBA,q.UNSIGNED_BYTE,n);q.bindTexture(q.TEXTURE_2D,null);this._resetContext();la[l.Ke]=null;l.Ke=c(w);n=l.getImageInfo();n.colorSpace=l.getColorSpace(); 21 | q=this._makeImageFromTexture(this.Md,l.Ke,n);w=l.Ld.Qd;var x=l.Ld.$d;l.Ld.Qd=q.Ld.Qd;l.Ld.$d=q.Ld.$d;q.Ld.Qd=w;q.Ld.$d=x;q.delete();n.colorSpace.delete()}};a.MakeLazyImageFromTextureSource=function(l,n){n||(n={height:f(l),width:h(l),colorType:a.ColorType.RGBA_8888,alphaType:a.AlphaType.Unpremul});n.colorSpace||(n.colorSpace=a.ColorSpace.SRGB);var q={makeTexture:function(){var w=v,x=w.je,J=x.createTexture();x.bindTexture(x.TEXTURE_2D,J);2===w.version?x.texImage2D(x.TEXTURE_2D,0,x.RGBA,n.width,n.height, 22 | 0,x.RGBA,x.UNSIGNED_BYTE,l):x.texImage2D(x.TEXTURE_2D,0,x.RGBA,x.RGBA,x.UNSIGNED_BYTE,l);x.bindTexture(x.TEXTURE_2D,null);return c(J)},freeSrc:function(){}};"VideoFrame"===l.constructor.name&&(q.freeSrc=function(){l.close()});return a.Image._makeFromGenerator(n,q)};a.Od=function(l){return l?na(l):!1}})})(t); 23 | (function(a){function b(e,d,g,m,r){for(var y=0;y>>0}function l(e){if(e&&e._ck)return e;if(e instanceof Float32Array){for(var d=Math.floor(e.length/4),g=new Uint32Array(d),m=0;mD;D++)a.HEAPF32[r+m]=e[y][D],m++;e=g}else e=V;d.de=e}else throw"Invalid argument to copyFlexibleColorArray, Not a color array "+typeof e;return d}function K(e){if(!e)return V;if(e.length){if(6===e.length||9===e.length)return x(e,"HEAPF32", 26 | Oa),6===e.length&&a.HEAPF32.set(Fd,6+Oa/4),Oa;if(16===e.length){var d=yb.toTypedArray();d[0]=e[0];d[1]=e[1];d[2]=e[3];d[3]=e[4];d[4]=e[5];d[5]=e[7];d[6]=e[12];d[7]=e[13];d[8]=e[15];return Oa}throw"invalid matrix size";}d=yb.toTypedArray();d[0]=e.m11;d[1]=e.m21;d[2]=e.m41;d[3]=e.m12;d[4]=e.m22;d[5]=e.m42;d[6]=e.m14;d[7]=e.m24;d[8]=e.m44;return Oa}function Q(e){if(!e)return V;var d=Yb.toTypedArray();if(e.length){if(16!==e.length&&6!==e.length&&9!==e.length)throw"invalid matrix size";if(16===e.length)return x(e, 27 | "HEAPF32",Za);d.fill(0);d[0]=e[0];d[1]=e[1];d[3]=e[2];d[4]=e[3];d[5]=e[4];d[7]=e[5];d[12]=e[6];d[13]=e[7];d[15]=e[8];6===e.length&&(d[12]=0,d[13]=0,d[15]=1);return Za}d[0]=e.m11;d[1]=e.m21;d[2]=e.m31;d[3]=e.m41;d[4]=e.m12;d[5]=e.m22;d[6]=e.m32;d[7]=e.m42;d[8]=e.m13;d[9]=e.m23;d[10]=e.m33;d[11]=e.m43;d[12]=e.m14;d[13]=e.m24;d[14]=e.m34;d[15]=e.m44;return Za}function A(e,d){return x(e,"HEAPF32",d||fb)}function L(e,d,g,m){var r=Zb.toTypedArray();r[0]=e;r[1]=d;r[2]=g;r[3]=m;return fb}function S(e){for(var d= 28 | new Float32Array(4),g=0;4>g;g++)d[g]=a.HEAPF32[e/4+g];return d}function T(e,d){return x(e,"HEAPF32",d||ia)}function oa(e,d){return x(e,"HEAPF32",d||$b)}function ta(){for(var e=0,d=0;d>>0};a.Color4f=function(e,d,g,m){void 0===m&&(m=1);return Float32Array.of(e,d,g,m)};Object.defineProperty(a,"TRANSPARENT",{get:function(){return a.Color4f(0,0,0,0)}});Object.defineProperty(a,"BLACK",{get:function(){return a.Color4f(0,0,0,1)}});Object.defineProperty(a,"WHITE",{get:function(){return a.Color4f(1,1,1,1)}});Object.defineProperty(a, 30 | "RED",{get:function(){return a.Color4f(1,0,0,1)}});Object.defineProperty(a,"GREEN",{get:function(){return a.Color4f(0,1,0,1)}});Object.defineProperty(a,"BLUE",{get:function(){return a.Color4f(0,0,1,1)}});Object.defineProperty(a,"YELLOW",{get:function(){return a.Color4f(1,1,0,1)}});Object.defineProperty(a,"CYAN",{get:function(){return a.Color4f(0,1,1,1)}});Object.defineProperty(a,"MAGENTA",{get:function(){return a.Color4f(1,0,1,1)}});a.getColorComponents=function(e){return[Math.floor(255*e[0]),Math.floor(255* 31 | e[1]),Math.floor(255*e[2]),e[3]]};a.parseColorString=function(e,d){e=e.toLowerCase();if(e.startsWith("#")){d=255;switch(e.length){case 9:d=parseInt(e.slice(7,9),16);case 7:var g=parseInt(e.slice(1,3),16);var m=parseInt(e.slice(3,5),16);var r=parseInt(e.slice(5,7),16);break;case 5:d=17*parseInt(e.slice(4,5),16);case 4:g=17*parseInt(e.slice(1,2),16),m=17*parseInt(e.slice(2,3),16),r=17*parseInt(e.slice(3,4),16)}return a.Color(g,m,r,d/255)}return e.startsWith("rgba")?(e=e.slice(5,-1),e=e.split(","),a.Color(+e[0], 32 | +e[1],+e[2],n(e[3]))):e.startsWith("rgb")?(e=e.slice(4,-1),e=e.split(","),a.Color(+e[0],+e[1],+e[2],n(e[3]))):e.startsWith("gray(")||e.startsWith("hsl")||!d||(e=d[e],void 0===e)?a.BLACK:e};a.multiplyByAlpha=function(e,d){e=e.slice();e[3]=Math.max(0,Math.min(e[3]*d,1));return e};a.Malloc=function(e,d){var g=a._malloc(d*e.BYTES_PER_ELEMENT);return{_ck:!0,length:d,byteOffset:g,pe:null,subarray:function(m,r){m=this.toTypedArray().subarray(m,r);m._ck=!0;return m},toTypedArray:function(){if(this.pe&&this.pe.length)return this.pe; 33 | this.pe=new e(a.HEAPU8.buffer,g,d);this.pe._ck=!0;return this.pe}}};a.Free=function(e){a._free(e.byteOffset);e.byteOffset=V;e.toTypedArray=null;e.pe=null};var Oa=V,yb,Za=V,Yb,fb=V,Zb,Ha,ia=V,Ic,Ta=V,Jc,ac=V,Kc,bc=V,Lc,cc=V,Mc,$b=V,Nc,Oc=V,Fd=Float32Array.of(0,0,1),V=0;a.onRuntimeInitialized=function(){function e(d,g,m,r,y,D){D||(D=4*r.width,r.colorType===a.ColorType.RGBA_F16?D*=2:r.colorType===a.ColorType.RGBA_F32&&(D*=4));var I=D*r.height;var N=y?y.byteOffset:a._malloc(I);if(!d._readPixels(r,N,D, 34 | g,m))return y||a._free(N),null;if(y)return y.toTypedArray();switch(r.colorType){case a.ColorType.RGBA_8888:case a.ColorType.RGBA_F16:d=(new Uint8Array(a.HEAPU8.buffer,N,I)).slice();break;case a.ColorType.RGBA_F32:d=(new Float32Array(a.HEAPU8.buffer,N,I)).slice();break;default:return null}a._free(N);return d}Zb=a.Malloc(Float32Array,4);fb=Zb.byteOffset;Yb=a.Malloc(Float32Array,16);Za=Yb.byteOffset;yb=a.Malloc(Float32Array,9);Oa=yb.byteOffset;Mc=a.Malloc(Float32Array,12);$b=Mc.byteOffset;Nc=a.Malloc(Float32Array, 35 | 12);Oc=Nc.byteOffset;Ha=a.Malloc(Float32Array,4);ia=Ha.byteOffset;Ic=a.Malloc(Float32Array,4);Ta=Ic.byteOffset;Jc=a.Malloc(Float32Array,3);ac=Jc.byteOffset;Kc=a.Malloc(Float32Array,3);bc=Kc.byteOffset;Lc=a.Malloc(Int32Array,4);cc=Lc.byteOffset;a.ColorSpace.SRGB=a.ColorSpace._MakeSRGB();a.ColorSpace.DISPLAY_P3=a.ColorSpace._MakeDisplayP3();a.ColorSpace.ADOBE_RGB=a.ColorSpace._MakeAdobeRGB();a.GlyphRunFlags={IsWhiteSpace:a._GlyphRunFlags_isWhiteSpace};a.Path.MakeFromCmds=function(d){var g=x(d,"HEAPF32"), 36 | m=a.Path._MakeFromCmds(g,d.length);w(g,d);return m};a.Path.MakeFromVerbsPointsWeights=function(d,g,m){var r=x(d,"HEAPU8"),y=x(g,"HEAPF32"),D=x(m,"HEAPF32"),I=a.Path._MakeFromVerbsPointsWeights(r,d.length,y,g.length,D,m&&m.length||0);w(r,d);w(y,g);w(D,m);return I};a.Path.prototype.addArc=function(d,g,m){d=T(d);this._addArc(d,g,m);return this};a.Path.prototype.addOval=function(d,g,m){void 0===m&&(m=1);d=T(d);this._addOval(d,!!g,m);return this};a.Path.prototype.addPath=function(){var d=Array.prototype.slice.call(arguments), 37 | g=d[0],m=!1;"boolean"===typeof d[d.length-1]&&(m=d.pop());if(1===d.length)this._addPath(g,1,0,0,0,1,0,0,0,1,m);else if(2===d.length)d=d[1],this._addPath(g,d[0],d[1],d[2],d[3],d[4],d[5],d[6]||0,d[7]||0,d[8]||1,m);else if(7===d.length||10===d.length)this._addPath(g,d[1],d[2],d[3],d[4],d[5],d[6],d[7]||0,d[8]||0,d[9]||1,m);else return null;return this};a.Path.prototype.addPoly=function(d,g){var m=x(d,"HEAPF32");this._addPoly(m,d.length/2,g);w(m,d);return this};a.Path.prototype.addRect=function(d,g){d= 38 | T(d);this._addRect(d,!!g);return this};a.Path.prototype.addRRect=function(d,g){d=oa(d);this._addRRect(d,!!g);return this};a.Path.prototype.addVerbsPointsWeights=function(d,g,m){var r=x(d,"HEAPU8"),y=x(g,"HEAPF32"),D=x(m,"HEAPF32");this._addVerbsPointsWeights(r,d.length,y,g.length,D,m&&m.length||0);w(r,d);w(y,g);w(D,m)};a.Path.prototype.arc=function(d,g,m,r,y,D){d=a.LTRBRect(d-m,g-m,d+m,g+m);y=(y-r)/Math.PI*180-360*!!D;D=new a.Path;D.addArc(d,r/Math.PI*180,y);this.addPath(D,!0);D.delete();return this}; 39 | a.Path.prototype.arcToOval=function(d,g,m,r){d=T(d);this._arcToOval(d,g,m,r);return this};a.Path.prototype.arcToRotated=function(d,g,m,r,y,D,I){this._arcToRotated(d,g,m,!!r,!!y,D,I);return this};a.Path.prototype.arcToTangent=function(d,g,m,r,y){this._arcToTangent(d,g,m,r,y);return this};a.Path.prototype.close=function(){this._close();return this};a.Path.prototype.conicTo=function(d,g,m,r,y){this._conicTo(d,g,m,r,y);return this};a.Path.prototype.computeTightBounds=function(d){this._computeTightBounds(ia); 40 | var g=Ha.toTypedArray();return d?(d.set(g),d):g.slice()};a.Path.prototype.cubicTo=function(d,g,m,r,y,D){this._cubicTo(d,g,m,r,y,D);return this};a.Path.prototype.dash=function(d,g,m){return this._dash(d,g,m)?this:null};a.Path.prototype.getBounds=function(d){this._getBounds(ia);var g=Ha.toTypedArray();return d?(d.set(g),d):g.slice()};a.Path.prototype.lineTo=function(d,g){this._lineTo(d,g);return this};a.Path.prototype.moveTo=function(d,g){this._moveTo(d,g);return this};a.Path.prototype.offset=function(d, 41 | g){this._transform(1,0,d,0,1,g,0,0,1);return this};a.Path.prototype.quadTo=function(d,g,m,r){this._quadTo(d,g,m,r);return this};a.Path.prototype.rArcTo=function(d,g,m,r,y,D,I){this._rArcTo(d,g,m,r,y,D,I);return this};a.Path.prototype.rConicTo=function(d,g,m,r,y){this._rConicTo(d,g,m,r,y);return this};a.Path.prototype.rCubicTo=function(d,g,m,r,y,D){this._rCubicTo(d,g,m,r,y,D);return this};a.Path.prototype.rLineTo=function(d,g){this._rLineTo(d,g);return this};a.Path.prototype.rMoveTo=function(d,g){this._rMoveTo(d, 42 | g);return this};a.Path.prototype.rQuadTo=function(d,g,m,r){this._rQuadTo(d,g,m,r);return this};a.Path.prototype.stroke=function(d){d=d||{};d.width=d.width||1;d.miter_limit=d.miter_limit||4;d.cap=d.cap||a.StrokeCap.Butt;d.join=d.join||a.StrokeJoin.Miter;d.precision=d.precision||1;return this._stroke(d)?this:null};a.Path.prototype.transform=function(){if(1===arguments.length){var d=arguments[0];this._transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6]||0,d[7]||0,d[8]||1)}else if(6===arguments.length||9=== 43 | arguments.length)d=arguments,this._transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6]||0,d[7]||0,d[8]||1);else throw"transform expected to take 1 or 9 arguments. Got "+arguments.length;return this};a.Path.prototype.trim=function(d,g,m){return this._trim(d,g,!!m)?this:null};a.Image.prototype.makeShaderCubic=function(d,g,m,r,y){y=K(y);return this._makeShaderCubic(d,g,m,r,y)};a.Image.prototype.makeShaderOptions=function(d,g,m,r,y){y=K(y);return this._makeShaderOptions(d,g,m,r,y)};a.Image.prototype.readPixels= 44 | function(d,g,m,r,y){return e(this,d,g,m,r,y)};a.Canvas.prototype.clear=function(d){a.Od(this.Md);d=A(d);this._clear(d)};a.Canvas.prototype.clipRRect=function(d,g,m){a.Od(this.Md);d=oa(d);this._clipRRect(d,g,m)};a.Canvas.prototype.clipRect=function(d,g,m){a.Od(this.Md);d=T(d);this._clipRect(d,g,m)};a.Canvas.prototype.concat=function(d){a.Od(this.Md);d=Q(d);this._concat(d)};a.Canvas.prototype.drawArc=function(d,g,m,r,y){a.Od(this.Md);d=T(d);this._drawArc(d,g,m,r,y)};a.Canvas.prototype.drawAtlas=function(d, 45 | g,m,r,y,D,I){if(d&&r&&g&&m&&g.length===m.length){a.Od(this.Md);y||(y=a.BlendMode.SrcOver);var N=x(g,"HEAPF32"),P=x(m,"HEAPF32"),W=m.length/4,u=x(l(D),"HEAPU32");if(I&&"B"in I&&"C"in I)this._drawAtlasCubic(d,P,N,u,W,y,I.B,I.C,r);else{let H=a.FilterMode.Linear,R=a.MipmapMode.None;I&&(H=I.filter,"mipmap"in I&&(R=I.mipmap));this._drawAtlasOptions(d,P,N,u,W,y,H,R,r)}w(N,g);w(P,m);w(u,D)}};a.Canvas.prototype.drawCircle=function(d,g,m,r){a.Od(this.Md);this._drawCircle(d,g,m,r)};a.Canvas.prototype.drawColor= 46 | function(d,g){a.Od(this.Md);d=A(d);void 0!==g?this._drawColor(d,g):this._drawColor(d)};a.Canvas.prototype.drawColorInt=function(d,g){a.Od(this.Md);this._drawColorInt(d,g||a.BlendMode.SrcOver)};a.Canvas.prototype.drawColorComponents=function(d,g,m,r,y){a.Od(this.Md);d=L(d,g,m,r);void 0!==y?this._drawColor(d,y):this._drawColor(d)};a.Canvas.prototype.drawDRRect=function(d,g,m){a.Od(this.Md);d=oa(d,$b);g=oa(g,Oc);this._drawDRRect(d,g,m)};a.Canvas.prototype.drawGlyphs=function(d,g,m,r,y,D){if(!(2*d.length<= 47 | g.length))throw"Not enough positions for the array of gyphs";a.Od(this.Md);const I=x(d,"HEAPU16"),N=x(g,"HEAPF32");this._drawGlyphs(d.length,I,N,m,r,y,D);w(N,g);w(I,d)};a.Canvas.prototype.drawImage=function(d,g,m,r){a.Od(this.Md);this._drawImage(d,g,m,r||null)};a.Canvas.prototype.drawImageCubic=function(d,g,m,r,y,D){a.Od(this.Md);this._drawImageCubic(d,g,m,r,y,D||null)};a.Canvas.prototype.drawImageOptions=function(d,g,m,r,y,D){a.Od(this.Md);this._drawImageOptions(d,g,m,r,y,D||null)};a.Canvas.prototype.drawImageNine= 48 | function(d,g,m,r,y){a.Od(this.Md);g=x(g,"HEAP32",cc);m=T(m);this._drawImageNine(d,g,m,r,y||null)};a.Canvas.prototype.drawImageRect=function(d,g,m,r,y){a.Od(this.Md);T(g,ia);T(m,Ta);this._drawImageRect(d,ia,Ta,r,!!y)};a.Canvas.prototype.drawImageRectCubic=function(d,g,m,r,y,D){a.Od(this.Md);T(g,ia);T(m,Ta);this._drawImageRectCubic(d,ia,Ta,r,y,D||null)};a.Canvas.prototype.drawImageRectOptions=function(d,g,m,r,y,D){a.Od(this.Md);T(g,ia);T(m,Ta);this._drawImageRectOptions(d,ia,Ta,r,y,D||null)};a.Canvas.prototype.drawLine= 49 | function(d,g,m,r,y){a.Od(this.Md);this._drawLine(d,g,m,r,y)};a.Canvas.prototype.drawOval=function(d,g){a.Od(this.Md);d=T(d);this._drawOval(d,g)};a.Canvas.prototype.drawPaint=function(d){a.Od(this.Md);this._drawPaint(d)};a.Canvas.prototype.drawParagraph=function(d,g,m){a.Od(this.Md);this._drawParagraph(d,g,m)};a.Canvas.prototype.drawPatch=function(d,g,m,r,y){if(24>d.length)throw"Need 12 cubic points";if(g&&4>g.length)throw"Need 4 colors";if(m&&8>m.length)throw"Need 4 shader coordinates";a.Od(this.Md); 50 | const D=x(d,"HEAPF32"),I=g?x(l(g),"HEAPU32"):V,N=m?x(m,"HEAPF32"):V;r||(r=a.BlendMode.Modulate);this._drawPatch(D,I,N,r,y);w(N,m);w(I,g);w(D,d)};a.Canvas.prototype.drawPath=function(d,g){a.Od(this.Md);this._drawPath(d,g)};a.Canvas.prototype.drawPicture=function(d){a.Od(this.Md);this._drawPicture(d)};a.Canvas.prototype.drawPoints=function(d,g,m){a.Od(this.Md);var r=x(g,"HEAPF32");this._drawPoints(d,r,g.length/2,m);w(r,g)};a.Canvas.prototype.drawRRect=function(d,g){a.Od(this.Md);d=oa(d);this._drawRRect(d, 51 | g)};a.Canvas.prototype.drawRect=function(d,g){a.Od(this.Md);d=T(d);this._drawRect(d,g)};a.Canvas.prototype.drawRect4f=function(d,g,m,r,y){a.Od(this.Md);this._drawRect4f(d,g,m,r,y)};a.Canvas.prototype.drawShadow=function(d,g,m,r,y,D,I){a.Od(this.Md);var N=x(y,"HEAPF32"),P=x(D,"HEAPF32");g=x(g,"HEAPF32",ac);m=x(m,"HEAPF32",bc);this._drawShadow(d,g,m,r,N,P,I);w(N,y);w(P,D)};a.getShadowLocalBounds=function(d,g,m,r,y,D,I){d=K(d);m=x(m,"HEAPF32",ac);r=x(r,"HEAPF32",bc);if(!this._getShadowLocalBounds(d, 52 | g,m,r,y,D,ia))return null;g=Ha.toTypedArray();return I?(I.set(g),I):g.slice()};a.Canvas.prototype.drawTextBlob=function(d,g,m,r){a.Od(this.Md);this._drawTextBlob(d,g,m,r)};a.Canvas.prototype.drawVertices=function(d,g,m){a.Od(this.Md);this._drawVertices(d,g,m)};a.Canvas.prototype.getLocalToDevice=function(){this._getLocalToDevice(Za);for(var d=Za,g=Array(16),m=0;16>m;m++)g[m]=a.HEAPF32[d/4+m];return g};a.Canvas.prototype.getTotalMatrix=function(){this._getTotalMatrix(Oa);for(var d=Array(9),g=0;9>g;g++)d[g]= 53 | a.HEAPF32[Oa/4+g];return d};a.Canvas.prototype.makeSurface=function(d){d=this._makeSurface(d);d.Md=this.Md;return d};a.Canvas.prototype.readPixels=function(d,g,m,r,y){a.Od(this.Md);return e(this,d,g,m,r,y)};a.Canvas.prototype.saveLayer=function(d,g,m,r){g=T(g);return this._saveLayer(d||null,g,m||null,r||0)};a.Canvas.prototype.writePixels=function(d,g,m,r,y,D,I,N){if(d.byteLength%(g*m))throw"pixels length must be a multiple of the srcWidth * srcHeight";a.Od(this.Md);var P=d.byteLength/(g*m);D=D||a.AlphaType.Unpremul; 54 | I=I||a.ColorType.RGBA_8888;N=N||a.ColorSpace.SRGB;var W=P*g;P=x(d,"HEAPU8");g=this._writePixels({width:g,height:m,colorType:I,alphaType:D,colorSpace:N},P,W,r,y);w(P,d);return g};a.ColorFilter.MakeBlend=function(d,g){d=A(d);return a.ColorFilter._MakeBlend(d,g)};a.ColorFilter.MakeMatrix=function(d){if(!d||20!==d.length)throw"invalid color matrix";var g=x(d,"HEAPF32"),m=a.ColorFilter._makeMatrix(g);w(g,d);return m};a.ContourMeasure.prototype.getPosTan=function(d,g){this._getPosTan(d,ia);d=Ha.toTypedArray(); 55 | return g?(g.set(d),g):d.slice()};a.ImageFilter.MakeMatrixTransform=function(d,g,m){d=K(d);if("B"in g&&"C"in g)return a.ImageFilter._MakeMatrixTransformCubic(d,g.Ag,g.Bg,m);const r=g.filter;let y=a.MipmapMode.None;"mipmap"in g&&(y=g.mipmap);return a.ImageFilter._MakeMatrixTransformOptions(d,r,y,m)};a.Paint.prototype.getColor=function(){this._getColor(fb);return S(fb)};a.Paint.prototype.setColor=function(d,g){g=g||null;d=A(d);this._setColor(d,g)};a.Paint.prototype.setColorComponents=function(d,g,m, 56 | r,y){y=y||null;d=L(d,g,m,r);this._setColor(d,y)};a.Path.prototype.getPoint=function(d,g){this._getPoint(d,ia);d=Ha.toTypedArray();return g?(g[0]=d[0],g[1]=d[1],g):d.slice(0,2)};a.PictureRecorder.prototype.beginRecording=function(d){d=T(d);return this._beginRecording(d)};a.Surface.prototype.getCanvas=function(){var d=this._getCanvas();d.Md=this.Md;return d};a.Surface.prototype.makeImageSnapshot=function(d){a.Od(this.Md);d=x(d,"HEAP32",cc);return this._makeImageSnapshot(d)};a.Surface.prototype.makeSurface= 57 | function(d){a.Od(this.Md);d=this._makeSurface(d);d.Md=this.Md;return d};a.Surface.prototype.requestAnimationFrame=function(d,g){this.Ge||(this.Ge=this.getCanvas());requestAnimationFrame(function(){a.Od(this.Md);d(this.Ge);this.flush(g)}.bind(this))};a.Surface.prototype.drawOnce=function(d,g){this.Ge||(this.Ge=this.getCanvas());requestAnimationFrame(function(){a.Od(this.Md);d(this.Ge);this.flush(g);this.dispose()}.bind(this))};a.PathEffect.MakeDash=function(d,g){g||(g=0);if(!d.length||1===d.length% 58 | 2)throw"Intervals array must have even length";var m=x(d,"HEAPF32");g=a.PathEffect._MakeDash(m,d.length,g);w(m,d);return g};a.PathEffect.MakeLine2D=function(d,g){g=K(g);return a.PathEffect._MakeLine2D(d,g)};a.PathEffect.MakePath2D=function(d,g){d=K(d);return a.PathEffect._MakePath2D(d,g)};a.Shader.MakeColor=function(d,g){g=g||null;d=A(d);return a.Shader._MakeColor(d,g)};a.Shader.Blend=a.Shader.MakeBlend;a.Shader.Color=a.Shader.MakeColor;a.Shader.MakeLinearGradient=function(d,g,m,r,y,D,I,N){N=N||null; 59 | var P=J(m),W=x(r,"HEAPF32");I=I||0;D=K(D);var u=Ha.toTypedArray();u.set(d);u.set(g,2);d=a.Shader._MakeLinearGradient(ia,P.de,P.Le,W,P.count,y,I,D,N);w(P.de,m);r&&w(W,r);return d};a.Shader.MakeRadialGradient=function(d,g,m,r,y,D,I,N){N=N||null;var P=J(m),W=x(r,"HEAPF32");I=I||0;D=K(D);d=a.Shader._MakeRadialGradient(d[0],d[1],g,P.de,P.Le,W,P.count,y,I,D,N);w(P.de,m);r&&w(W,r);return d};a.Shader.MakeSweepGradient=function(d,g,m,r,y,D,I,N,P,W){W=W||null;var u=J(m),H=x(r,"HEAPF32");I=I||0;N=N||0;P=P|| 60 | 360;D=K(D);d=a.Shader._MakeSweepGradient(d,g,u.de,u.Le,H,u.count,y,N,P,I,D,W);w(u.de,m);r&&w(H,r);return d};a.Shader.MakeTwoPointConicalGradient=function(d,g,m,r,y,D,I,N,P,W){W=W||null;var u=J(y),H=x(D,"HEAPF32");P=P||0;N=K(N);var R=Ha.toTypedArray();R.set(d);R.set(m,2);d=a.Shader._MakeTwoPointConicalGradient(ia,g,r,u.de,u.Le,H,u.count,I,P,N,W);w(u.de,y);D&&w(H,D);return d};a.Vertices.prototype.bounds=function(d){this._bounds(ia);var g=Ha.toTypedArray();return d?(d.set(g),d):g.slice()};a.Vd&&a.Vd.forEach(function(d){d()})}; 61 | a.computeTonalColors=function(e){var d=x(e.ambient,"HEAPF32"),g=x(e.spot,"HEAPF32");this._computeTonalColors(d,g);var m={ambient:S(d),spot:S(g)};w(d,e.ambient);w(g,e.spot);return m};a.LTRBRect=function(e,d,g,m){return Float32Array.of(e,d,g,m)};a.XYWHRect=function(e,d,g,m){return Float32Array.of(e,d,e+g,d+m)};a.LTRBiRect=function(e,d,g,m){return Int32Array.of(e,d,g,m)};a.XYWHiRect=function(e,d,g,m){return Int32Array.of(e,d,e+g,d+m)};a.RRectXY=function(e,d,g){return Float32Array.of(e[0],e[1],e[2],e[3], 62 | d,g,d,g,d,g,d,g)};a.MakeAnimatedImageFromEncoded=function(e){e=new Uint8Array(e);var d=a._malloc(e.byteLength);a.HEAPU8.set(e,d);return(e=a._decodeAnimatedImage(d,e.byteLength))?e:null};a.MakeImageFromEncoded=function(e){e=new Uint8Array(e);var d=a._malloc(e.byteLength);a.HEAPU8.set(e,d);return(e=a._decodeImage(d,e.byteLength))?e:null};var ib=null;a.MakeImageFromCanvasImageSource=function(e){var d=e.width,g=e.height;ib||(ib=document.createElement("canvas"));ib.width=d;ib.height=g;var m=ib.getContext("2d", 63 | {Jg:!0});m.drawImage(e,0,0);e=m.getImageData(0,0,d,g);return a.MakeImage({width:d,height:g,alphaType:a.AlphaType.Unpremul,colorType:a.ColorType.RGBA_8888,colorSpace:a.ColorSpace.SRGB},e.data,4*d)};a.MakeImage=function(e,d,g){var m=a._malloc(d.length);a.HEAPU8.set(d,m);return a._MakeImage(e,m,d.length,g)};a.MakeVertices=function(e,d,g,m,r,y){var D=r&&r.length||0,I=0;g&&g.length&&(I|=1);m&&m.length&&(I|=2);void 0===y||y||(I|=4);e=new a._VerticesBuilder(e,d.length/2,D,I);x(d,"HEAPF32",e.positions()); 64 | e.texCoords()&&x(g,"HEAPF32",e.texCoords());e.colors()&&x(l(m),"HEAPU32",e.colors());e.indices()&&x(r,"HEAPU16",e.indices());return e.detach()};a.Matrix={};a.Matrix.identity=function(){return c(3)};a.Matrix.invert=function(e){var d=e[0]*e[4]*e[8]+e[1]*e[5]*e[6]+e[2]*e[3]*e[7]-e[2]*e[4]*e[6]-e[1]*e[3]*e[8]-e[0]*e[5]*e[7];return d?[(e[4]*e[8]-e[5]*e[7])/d,(e[2]*e[7]-e[1]*e[8])/d,(e[1]*e[5]-e[2]*e[4])/d,(e[5]*e[6]-e[3]*e[8])/d,(e[0]*e[8]-e[2]*e[6])/d,(e[2]*e[3]-e[0]*e[5])/d,(e[3]*e[7]-e[4]*e[6])/d,(e[1]* 65 | e[6]-e[0]*e[7])/d,(e[0]*e[4]-e[1]*e[3])/d]:null};a.Matrix.mapPoints=function(e,d){for(var g=0;gr;r+=5){for(var y=0;4>y;y++)g[m++]=e[r]*d[y]+e[r+1]*d[y+5]+e[r+2]*d[y+10]+e[r+3]*d[y+15];g[m++]=e[r]*d[4]+e[r+1]*d[9]+e[r+2]*d[14]+e[r+3]*d[19]+e[r+4]}return g};(function(e){e.Vd=e.Vd||[];e.Vd.push(function(){function d(u){if(!u||!u.length)return[];for(var H=[],R=0;Rd)return a._free(e),null;r=new Uint16Array(a.HEAPU8.buffer,e,d);if(g)return g.set(r),a._free(e),g;g=Uint16Array.from(r);a._free(e);return g};a.Font.prototype.getGlyphIntercepts=function(e,d,g,m){var r= 85 | x(e,"HEAPU16"),y=x(d,"HEAPF32");return this._getGlyphIntercepts(r,e.length,!(e&&e._ck),y,d.length,!(d&&d._ck),g,m)};a.Font.prototype.getGlyphWidths=function(e,d,g){var m=x(e,"HEAPU16"),r=a._malloc(4*e.length);this._getGlyphWidthBounds(m,e.length,r,V,d||null);d=new Float32Array(a.HEAPU8.buffer,r,e.length);w(m,e);if(g)return g.set(d),a._free(r),g;e=Float32Array.from(d);a._free(r);return e};a.FontMgr.FromData=function(){if(!arguments.length)return null;var e=arguments;1===e.length&&Array.isArray(e[0])&& 86 | (e=arguments[0]);if(!e.length)return null;for(var d=[],g=[],m=0;md)return a._free(e),null;r=new Uint16Array(a.HEAPU8.buffer,e,d);if(g)return g.set(r),a._free(e),g;g=Uint16Array.from(r);a._free(e);return g};a.TextBlob.MakeOnPath=function(e,d,g,m){if(e&&e.length&&d&&d.countPoints()){if(1===d.countPoints())return this.MakeFromText(e,g);m||(m=0);var r=g.getGlyphIDs(e);r=g.getGlyphWidths(r);var y=[];d=new a.ContourMeasureIter(d,!1,1);for(var D=d.next(),I=new Float32Array(4),N=0;ND.length()){D.delete();D=d.next();if(!D){e=e.substring(0,N);break}m=P/2}D.getPosTan(m,I);var W=I[2],u=I[3];y.push(W,u,I[0]-P/2*W,I[1]-P/2*u);m+=P/2}e=this.MakeFromRSXform(e,y,g);D&&D.delete();d.delete();return e}};a.TextBlob.MakeFromRSXform=function(e,d,g){var m=ra(e)+1,r=a._malloc(m);sa(e,G,r,m);e=x(d,"HEAPF32");g=a.TextBlob._MakeFromRSXform(r,m-1,e,g);a._free(r);return g?g:null};a.TextBlob.MakeFromRSXformGlyphs=function(e,d,g){var m=x(e,"HEAPU16");d=x(d,"HEAPF32"); 89 | g=a.TextBlob._MakeFromRSXformGlyphs(m,2*e.length,d,g);w(m,e);return g?g:null};a.TextBlob.MakeFromGlyphs=function(e,d){var g=x(e,"HEAPU16");d=a.TextBlob._MakeFromGlyphs(g,2*e.length,d);w(g,e);return d?d:null};a.TextBlob.MakeFromText=function(e,d){var g=ra(e)+1,m=a._malloc(g);sa(e,G,m,g);e=a.TextBlob._MakeFromText(m,g-1,d);a._free(m);return e?e:null};a.MallocGlyphIDs=function(e){return a.Malloc(Uint16Array,e)}});a.Vd=a.Vd||[];a.Vd.push(function(){a.MakePicture=function(e){e=new Uint8Array(e);var d= 90 | a._malloc(e.byteLength);a.HEAPU8.set(e,d);return(e=a._MakePicture(d,e.byteLength))?e:null}});(function(){function e(F){for(var k=0;kk||1=k||!k||(this.Je=k,this.Rd.setStrokeWidth(k))}});Object.defineProperty(this,"miterLimit",{enumerable:!0, 103 | get:function(){return this.Rd.getStrokeMiter()},set:function(k){0>=k||!k||this.Rd.setStrokeMiter(k)}});Object.defineProperty(this,"shadowBlur",{enumerable:!0,get:function(){return this.ue},set:function(k){0>k||!isFinite(k)||(this.ue=k)}});Object.defineProperty(this,"shadowColor",{enumerable:!0,get:function(){return d(this.Ie)},set:function(k){this.Ie=g(k)}});Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,get:function(){return this.ve},set:function(k){isFinite(k)&&(this.ve=k)}});Object.defineProperty(this, 104 | "shadowOffsetY",{enumerable:!0,get:function(){return this.we},set:function(k){isFinite(k)&&(this.we=k)}});Object.defineProperty(this,"strokeStyle",{enumerable:!0,get:function(){return d(this.he)},set:function(k){"string"===typeof k?this.he=g(k):k.se&&(this.he=k)}});this.arc=function(k,p,z,B,C,E){H(this.Td,k,p,z,z,0,B,C,E)};this.arcTo=function(k,p,z,B,C){P(this.Td,k,p,z,B,C)};this.beginPath=function(){this.Td.delete();this.Td=new a.Path};this.bezierCurveTo=function(k,p,z,B,C,E){var M=this.Td;e([k, 105 | p,z,B,C,E])&&(M.isEmpty()&&M.moveTo(k,p),M.cubicTo(k,p,z,B,C,E))};this.clearRect=function(k,p,z,B){this.Rd.setStyle(a.PaintStyle.Fill);this.Rd.setBlendMode(a.BlendMode.Clear);this.Nd.drawRect(a.XYWHRect(k,p,z,B),this.Rd);this.Rd.setBlendMode(this.Pd)};this.clip=function(k,p){"string"===typeof k?(p=k,k=this.Td):k&&k.af&&(k=k.Wd);k||(k=this.Td);k=k.copy();p&&"evenodd"===p.toLowerCase()?k.setFillType(a.FillType.EvenOdd):k.setFillType(a.FillType.Winding);this.Nd.clipPath(k,a.ClipOp.Intersect,!0);k.delete()}; 106 | this.closePath=function(){W(this.Td)};this.createImageData=function(){if(1===arguments.length){var k=arguments[0];return new I(new Uint8ClampedArray(4*k.width*k.height),k.width,k.height)}if(2===arguments.length){k=arguments[0];var p=arguments[1];return new I(new Uint8ClampedArray(4*k*p),k,p)}throw"createImageData expects 1 or 2 arguments, got "+arguments.length;};this.createLinearGradient=function(k,p,z,B){if(e(arguments)){var C=new N(k,p,z,B);this.Ae.push(C);return C}};this.createPattern=function(k, 107 | p){k=new ja(k,p);this.Ae.push(k);return k};this.createRadialGradient=function(k,p,z,B,C,E){if(e(arguments)){var M=new pa(k,p,z,B,C,E);this.Ae.push(M);return M}};this.drawImage=function(k){k instanceof D&&(k=k.tf());var p=this.Qe();if(3===arguments.length||5===arguments.length)var z=a.XYWHRect(arguments[1],arguments[2],arguments[3]||k.width(),arguments[4]||k.height()),B=a.XYWHRect(0,0,k.width(),k.height());else if(9===arguments.length)z=a.XYWHRect(arguments[5],arguments[6],arguments[7],arguments[8]), 108 | B=a.XYWHRect(arguments[1],arguments[2],arguments[3],arguments[4]);else throw"invalid number of args for drawImage, need 3, 5, or 9; got "+arguments.length;this.Nd.drawImageRect(k,B,z,p,!1);p.dispose()};this.ellipse=function(k,p,z,B,C,E,M,ba){H(this.Td,k,p,z,B,C,E,M,ba)};this.Qe=function(){var k=this.Rd.copy();k.setStyle(a.PaintStyle.Fill);if(f(this.ce)){var p=a.multiplyByAlpha(this.ce,this.ke);k.setColor(p)}else p=this.ce.se(this.Ud),k.setColor(a.Color(0,0,0,this.ke)),k.setShader(p);k.dispose=function(){this.delete()}; 109 | return k};this.fill=function(k,p){"string"===typeof k?(p=k,k=this.Td):k&&k.af&&(k=k.Wd);if("evenodd"===p)this.Td.setFillType(a.FillType.EvenOdd);else{if("nonzero"!==p&&p)throw"invalid fill rule";this.Td.setFillType(a.FillType.Winding)}k||(k=this.Td);p=this.Qe();var z=this.xe(p);z&&(this.Nd.save(),this.qe(),this.Nd.drawPath(k,z),this.Nd.restore(),z.dispose());this.Nd.drawPath(k,p);p.dispose()};this.fillRect=function(k,p,z,B){var C=this.Qe(),E=this.xe(C);E&&(this.Nd.save(),this.qe(),this.Nd.drawRect(a.XYWHRect(k, 110 | p,z,B),E),this.Nd.restore(),E.dispose());this.Nd.drawRect(a.XYWHRect(k,p,z,B),C);C.dispose()};this.fillText=function(k,p,z){var B=this.Qe();k=a.TextBlob.MakeFromText(k,this.ne);var C=this.xe(B);C&&(this.Nd.save(),this.qe(),this.Nd.drawTextBlob(k,p,z,C),this.Nd.restore(),C.dispose());this.Nd.drawTextBlob(k,p,z,B);k.delete();B.dispose()};this.getImageData=function(k,p,z,B){return(k=this.Nd.readPixels(k,p,{width:z,height:B,colorType:a.ColorType.RGBA_8888,alphaType:a.AlphaType.Unpremul,colorSpace:a.ColorSpace.SRGB}))? 111 | new I(new Uint8ClampedArray(k.buffer),z,B):null};this.getLineDash=function(){return this.te.slice()};this.mf=function(k){var p=a.Matrix.invert(this.Ud);a.Matrix.mapPoints(p,k);return k};this.isPointInPath=function(k,p,z){var B=arguments;if(3===B.length)var C=this.Td;else if(4===B.length)C=B[0],k=B[1],p=B[2],z=B[3];else throw"invalid arg count, need 3 or 4, got "+B.length;if(!isFinite(k)||!isFinite(p))return!1;z=z||"nonzero";if("nonzero"!==z&&"evenodd"!==z)return!1;B=this.mf([k,p]);k=B[0];p=B[1];C.setFillType("nonzero"=== 112 | z?a.FillType.Winding:a.FillType.EvenOdd);return C.contains(k,p)};this.isPointInStroke=function(k,p){var z=arguments;if(2===z.length)var B=this.Td;else if(3===z.length)B=z[0],k=z[1],p=z[2];else throw"invalid arg count, need 2 or 3, got "+z.length;if(!isFinite(k)||!isFinite(p))return!1;z=this.mf([k,p]);k=z[0];p=z[1];B=B.copy();B.setFillType(a.FillType.Winding);B.stroke({width:this.lineWidth,miter_limit:this.miterLimit,cap:this.Rd.getStrokeCap(),join:this.Rd.getStrokeJoin(),precision:.3});z=B.contains(k, 113 | p);B.delete();return z};this.lineTo=function(k,p){R(this.Td,k,p)};this.measureText=function(k){k=this.ne.getGlyphIDs(k);k=this.ne.getGlyphWidths(k);let p=0;for(const z of k)p+=z;return{width:p}};this.moveTo=function(k,p){var z=this.Td;e([k,p])&&z.moveTo(k,p)};this.putImageData=function(k,p,z,B,C,E,M){if(e([p,z,B,C,E,M]))if(void 0===B)this.Nd.writePixels(k.data,k.width,k.height,p,z);else if(B=B||0,C=C||0,E=E||k.width,M=M||k.height,0>E&&(B+=E,E=Math.abs(E)),0>M&&(C+=M,M=Math.abs(M)),0>B&&(E+=B,B=0), 114 | 0>C&&(M+=C,C=0),!(0>=E||0>=M)){k=a.MakeImage({width:k.width,height:k.height,alphaType:a.AlphaType.Unpremul,colorType:a.ColorType.RGBA_8888,colorSpace:a.ColorSpace.SRGB},k.data,4*k.width);var ba=a.XYWHRect(B,C,E,M);p=a.XYWHRect(p+B,z+C,E,M);z=a.Matrix.invert(this.Ud);this.Nd.save();this.Nd.concat(z);this.Nd.drawImageRect(k,ba,p,null,!1);this.Nd.restore();k.delete()}};this.quadraticCurveTo=function(k,p,z,B){var C=this.Td;e([k,p,z,B])&&(C.isEmpty()&&C.moveTo(k,p),C.quadTo(k,p,z,B))};this.rect=function(k, 115 | p,z,B){var C=this.Td;k=a.XYWHRect(k,p,z,B);e(k)&&C.addRect(k)};this.resetTransform=function(){this.Td.transform(this.Ud);var k=a.Matrix.invert(this.Ud);this.Nd.concat(k);this.Ud=this.Nd.getTotalMatrix()};this.restore=function(){var k=this.lf.pop();if(k){var p=a.Matrix.multiply(this.Ud,a.Matrix.invert(k.Ff));this.Td.transform(p);this.Rd.delete();this.Rd=k.dg;this.te=k.$f;this.Je=k.vg;this.he=k.ug;this.ce=k.fs;this.ve=k.sg;this.we=k.tg;this.ue=k.hg;this.Ie=k.rg;this.ke=k.Nf;this.Pd=k.Of;this.He=k.ag; 116 | this.Re=k.Mf;this.Nd.restore();this.Ud=this.Nd.getTotalMatrix()}};this.rotate=function(k){if(isFinite(k)){var p=a.Matrix.rotated(-k);this.Td.transform(p);this.Nd.rotate(k/Math.PI*180,0,0);this.Ud=this.Nd.getTotalMatrix()}};this.save=function(){if(this.ce.re){var k=this.ce.re();this.Ae.push(k)}else k=this.ce;if(this.he.re){var p=this.he.re();this.Ae.push(p)}else p=this.he;this.lf.push({Ff:this.Ud.slice(),$f:this.te.slice(),vg:this.Je,ug:p,fs:k,sg:this.ve,tg:this.we,hg:this.ue,rg:this.Ie,Nf:this.ke, 117 | ag:this.He,Of:this.Pd,dg:this.Rd.copy(),Mf:this.Re});this.Nd.save()};this.scale=function(k,p){if(e(arguments)){var z=a.Matrix.scaled(1/k,1/p);this.Td.transform(z);this.Nd.scale(k,p);this.Ud=this.Nd.getTotalMatrix()}};this.setLineDash=function(k){for(var p=0;pk[p])return;1===k.length%2&&Array.prototype.push.apply(k,k);this.te=k};this.setTransform=function(k,p,z,B,C,E){e(arguments)&&(this.resetTransform(),this.transform(k,p,z,B,C,E))};this.qe=function(){var k=a.Matrix.invert(this.Ud); 118 | this.Nd.concat(k);this.Nd.concat(a.Matrix.translated(this.ve,this.we));this.Nd.concat(this.Ud)};this.xe=function(k){var p=a.multiplyByAlpha(this.Ie,this.ke);if(!a.getColorComponents(p)[3]||!(this.ue||this.we||this.ve))return null;k=k.copy();k.setColor(p);var z=a.MaskFilter.MakeBlur(a.BlurStyle.Normal,this.ue/2,!1);k.setMaskFilter(z);k.dispose=function(){z.delete();this.delete()};return k};this.cf=function(){var k=this.Rd.copy();k.setStyle(a.PaintStyle.Stroke);if(f(this.he)){var p=a.multiplyByAlpha(this.he, 119 | this.ke);k.setColor(p)}else p=this.he.se(this.Ud),k.setColor(a.Color(0,0,0,this.ke)),k.setShader(p);k.setStrokeWidth(this.Je);if(this.te.length){var z=a.PathEffect.MakeDash(this.te,this.He);k.setPathEffect(z)}k.dispose=function(){z&&z.delete();this.delete()};return k};this.stroke=function(k){k=k?k.Wd:this.Td;var p=this.cf(),z=this.xe(p);z&&(this.Nd.save(),this.qe(),this.Nd.drawPath(k,z),this.Nd.restore(),z.dispose());this.Nd.drawPath(k,p);p.dispose()};this.strokeRect=function(k,p,z,B){var C=this.cf(), 120 | E=this.xe(C);E&&(this.Nd.save(),this.qe(),this.Nd.drawRect(a.XYWHRect(k,p,z,B),E),this.Nd.restore(),E.dispose());this.Nd.drawRect(a.XYWHRect(k,p,z,B),C);C.dispose()};this.strokeText=function(k,p,z){var B=this.cf();k=a.TextBlob.MakeFromText(k,this.ne);var C=this.xe(B);C&&(this.Nd.save(),this.qe(),this.Nd.drawTextBlob(k,p,z,C),this.Nd.restore(),C.dispose());this.Nd.drawTextBlob(k,p,z,B);k.delete();B.dispose()};this.translate=function(k,p){if(e(arguments)){var z=a.Matrix.translated(-k,-p);this.Td.transform(z); 121 | this.Nd.translate(k,p);this.Ud=this.Nd.getTotalMatrix()}};this.transform=function(k,p,z,B,C,E){k=[k,z,C,p,B,E,0,0,1];p=a.Matrix.invert(k);this.Td.transform(p);this.Nd.concat(k);this.Ud=this.Nd.getTotalMatrix()};this.addHitRegion=function(){};this.clearHitRegions=function(){};this.drawFocusIfNeeded=function(){};this.removeHitRegion=function(){};this.scrollPathIntoView=function(){};Object.defineProperty(this,"canvas",{value:null,writable:!1})}function y(F){this.df=F;this.Md=new r(F.getCanvas());this.Se= 122 | [];this.decodeImage=function(k){k=a.MakeImageFromEncoded(k);if(!k)throw"Invalid input";this.Se.push(k);return new D(k)};this.loadFont=function(k,p){k=a.Typeface.MakeFreeTypeFaceFromData(k);if(!k)return null;this.Se.push(k);var z=(p.style||"normal")+"|"+(p.variant||"normal")+"|"+(p.weight||"normal");p=p.family;ea[p]||(ea[p]={"*":k});ea[p][z]=k};this.makePath2D=function(k){k=new aa(k);this.Se.push(k.Wd);return k};this.getContext=function(k){return"2d"===k?this.Md:null};this.toDataURL=function(k,p){this.df.flush(); 123 | var z=this.df.makeImageSnapshot();if(z){k=k||"image/png";var B=a.ImageFormat.PNG;"image/jpeg"===k&&(B=a.ImageFormat.JPEG);if(p=z.encodeToBytes(B,p||.92)){z.delete();k="data:"+k+";base64,";if("undefined"!==typeof Buffer)p=Buffer.from(p).toString("base64");else{z=0;B=p.length;for(var C="",E;zB||1B);E++);this.ae.splice(E,0,B);this.ee.splice(E,0,C)}};this.re=function(){var B=new N(F,k,p,z);B.ee=this.ee.slice();B.ae=this.ae.slice();return B};this.me=function(){this.Yd&&(this.Yd.delete(),this.Yd=null)};this.se=function(B){var C=[F,k,p,z];a.Matrix.mapPoints(B,C);B=C[0];var E=C[1], 126 | M=C[2];C=C[3];this.me();return this.Yd=a.Shader.MakeLinearGradient([B,E],[M,C],this.ee,this.ae,a.TileMode.Clamp)}}function P(F,k,p,z,B,C){if(e([k,p,z,B,C])){if(0>C)throw"radii cannot be negative";F.isEmpty()&&F.moveTo(k,p);F.arcToTangent(k,p,z,B,C)}}function W(F){if(!F.isEmpty()){var k=F.getBounds();(k[3]-k[1]||k[2]-k[0])&&F.close()}}function u(F,k,p,z,B,C,E){E=(E-C)/Math.PI*180;C=C/Math.PI*180;k=a.LTRBRect(k-z,p-B,k+z,p+B);1E-5>Math.abs(Math.abs(E)-360)?(p=E/2,F.arcToOval(k,C,p,!1),F.arcToOval(k, 127 | C+p,p,!1)):F.arcToOval(k,C,E,!1)}function H(F,k,p,z,B,C,E,M,ba){if(e([k,p,z,B,C,E,M])){if(0>z||0>B)throw"radii cannot be negative";var ca=2*Math.PI,Ia=E%ca;0>Ia&&(Ia+=ca);var $a=Ia-E;E=Ia;M+=$a;!ba&&M-E>=ca?M=E+ca:ba&&E-M>=ca?M=E-ca:!ba&&E>M?M=E+(ca-(E-M)%ca):ba&&EE||1E);ba++);this.ae.splice(ba,0,E);this.ee.splice(ba,0,M)}};this.re=function(){var E=new pa(F,k,p,z,B,C);E.ee=this.ee.slice();E.ae= 132 | this.ae.slice();return E};this.me=function(){this.Yd&&(this.Yd.delete(),this.Yd=null)};this.se=function(E){var M=[F,k,z,B];a.Matrix.mapPoints(E,M);var ba=M[0],ca=M[1],Ia=M[2];M=M[3];var $a=(Math.abs(E[0])+Math.abs(E[4]))/2;E=p*$a;$a*=C;this.me();return this.Yd=a.Shader.MakeTwoPointConicalGradient([ba,ca],E,[Ia,M],$a,this.ee,this.ae,a.TileMode.Clamp)}}a._testing={};var ua={aliceblue:Float32Array.of(.941,.973,1,1),antiquewhite:Float32Array.of(.98,.922,.843,1),aqua:Float32Array.of(0,1,1,1),aquamarine:Float32Array.of(.498, 133 | 1,.831,1),azure:Float32Array.of(.941,1,1,1),beige:Float32Array.of(.961,.961,.863,1),bisque:Float32Array.of(1,.894,.769,1),black:Float32Array.of(0,0,0,1),blanchedalmond:Float32Array.of(1,.922,.804,1),blue:Float32Array.of(0,0,1,1),blueviolet:Float32Array.of(.541,.169,.886,1),brown:Float32Array.of(.647,.165,.165,1),burlywood:Float32Array.of(.871,.722,.529,1),cadetblue:Float32Array.of(.373,.62,.627,1),chartreuse:Float32Array.of(.498,1,0,1),chocolate:Float32Array.of(.824,.412,.118,1),coral:Float32Array.of(1, 134 | .498,.314,1),cornflowerblue:Float32Array.of(.392,.584,.929,1),cornsilk:Float32Array.of(1,.973,.863,1),crimson:Float32Array.of(.863,.078,.235,1),cyan:Float32Array.of(0,1,1,1),darkblue:Float32Array.of(0,0,.545,1),darkcyan:Float32Array.of(0,.545,.545,1),darkgoldenrod:Float32Array.of(.722,.525,.043,1),darkgray:Float32Array.of(.663,.663,.663,1),darkgreen:Float32Array.of(0,.392,0,1),darkgrey:Float32Array.of(.663,.663,.663,1),darkkhaki:Float32Array.of(.741,.718,.42,1),darkmagenta:Float32Array.of(.545,0, 135 | .545,1),darkolivegreen:Float32Array.of(.333,.42,.184,1),darkorange:Float32Array.of(1,.549,0,1),darkorchid:Float32Array.of(.6,.196,.8,1),darkred:Float32Array.of(.545,0,0,1),darksalmon:Float32Array.of(.914,.588,.478,1),darkseagreen:Float32Array.of(.561,.737,.561,1),darkslateblue:Float32Array.of(.282,.239,.545,1),darkslategray:Float32Array.of(.184,.31,.31,1),darkslategrey:Float32Array.of(.184,.31,.31,1),darkturquoise:Float32Array.of(0,.808,.82,1),darkviolet:Float32Array.of(.58,0,.827,1),deeppink:Float32Array.of(1, 136 | .078,.576,1),deepskyblue:Float32Array.of(0,.749,1,1),dimgray:Float32Array.of(.412,.412,.412,1),dimgrey:Float32Array.of(.412,.412,.412,1),dodgerblue:Float32Array.of(.118,.565,1,1),firebrick:Float32Array.of(.698,.133,.133,1),floralwhite:Float32Array.of(1,.98,.941,1),forestgreen:Float32Array.of(.133,.545,.133,1),fuchsia:Float32Array.of(1,0,1,1),gainsboro:Float32Array.of(.863,.863,.863,1),ghostwhite:Float32Array.of(.973,.973,1,1),gold:Float32Array.of(1,.843,0,1),goldenrod:Float32Array.of(.855,.647,.125, 137 | 1),gray:Float32Array.of(.502,.502,.502,1),green:Float32Array.of(0,.502,0,1),greenyellow:Float32Array.of(.678,1,.184,1),grey:Float32Array.of(.502,.502,.502,1),honeydew:Float32Array.of(.941,1,.941,1),hotpink:Float32Array.of(1,.412,.706,1),indianred:Float32Array.of(.804,.361,.361,1),indigo:Float32Array.of(.294,0,.51,1),ivory:Float32Array.of(1,1,.941,1),khaki:Float32Array.of(.941,.902,.549,1),lavender:Float32Array.of(.902,.902,.98,1),lavenderblush:Float32Array.of(1,.941,.961,1),lawngreen:Float32Array.of(.486, 138 | .988,0,1),lemonchiffon:Float32Array.of(1,.98,.804,1),lightblue:Float32Array.of(.678,.847,.902,1),lightcoral:Float32Array.of(.941,.502,.502,1),lightcyan:Float32Array.of(.878,1,1,1),lightgoldenrodyellow:Float32Array.of(.98,.98,.824,1),lightgray:Float32Array.of(.827,.827,.827,1),lightgreen:Float32Array.of(.565,.933,.565,1),lightgrey:Float32Array.of(.827,.827,.827,1),lightpink:Float32Array.of(1,.714,.757,1),lightsalmon:Float32Array.of(1,.627,.478,1),lightseagreen:Float32Array.of(.125,.698,.667,1),lightskyblue:Float32Array.of(.529, 139 | .808,.98,1),lightslategray:Float32Array.of(.467,.533,.6,1),lightslategrey:Float32Array.of(.467,.533,.6,1),lightsteelblue:Float32Array.of(.69,.769,.871,1),lightyellow:Float32Array.of(1,1,.878,1),lime:Float32Array.of(0,1,0,1),limegreen:Float32Array.of(.196,.804,.196,1),linen:Float32Array.of(.98,.941,.902,1),magenta:Float32Array.of(1,0,1,1),maroon:Float32Array.of(.502,0,0,1),mediumaquamarine:Float32Array.of(.4,.804,.667,1),mediumblue:Float32Array.of(0,0,.804,1),mediumorchid:Float32Array.of(.729,.333, 140 | .827,1),mediumpurple:Float32Array.of(.576,.439,.859,1),mediumseagreen:Float32Array.of(.235,.702,.443,1),mediumslateblue:Float32Array.of(.482,.408,.933,1),mediumspringgreen:Float32Array.of(0,.98,.604,1),mediumturquoise:Float32Array.of(.282,.82,.8,1),mediumvioletred:Float32Array.of(.78,.082,.522,1),midnightblue:Float32Array.of(.098,.098,.439,1),mintcream:Float32Array.of(.961,1,.98,1),mistyrose:Float32Array.of(1,.894,.882,1),moccasin:Float32Array.of(1,.894,.71,1),navajowhite:Float32Array.of(1,.871,.678, 141 | 1),navy:Float32Array.of(0,0,.502,1),oldlace:Float32Array.of(.992,.961,.902,1),olive:Float32Array.of(.502,.502,0,1),olivedrab:Float32Array.of(.42,.557,.137,1),orange:Float32Array.of(1,.647,0,1),orangered:Float32Array.of(1,.271,0,1),orchid:Float32Array.of(.855,.439,.839,1),palegoldenrod:Float32Array.of(.933,.91,.667,1),palegreen:Float32Array.of(.596,.984,.596,1),paleturquoise:Float32Array.of(.686,.933,.933,1),palevioletred:Float32Array.of(.859,.439,.576,1),papayawhip:Float32Array.of(1,.937,.835,1), 142 | peachpuff:Float32Array.of(1,.855,.725,1),peru:Float32Array.of(.804,.522,.247,1),pink:Float32Array.of(1,.753,.796,1),plum:Float32Array.of(.867,.627,.867,1),powderblue:Float32Array.of(.69,.878,.902,1),purple:Float32Array.of(.502,0,.502,1),rebeccapurple:Float32Array.of(.4,.2,.6,1),red:Float32Array.of(1,0,0,1),rosybrown:Float32Array.of(.737,.561,.561,1),royalblue:Float32Array.of(.255,.412,.882,1),saddlebrown:Float32Array.of(.545,.271,.075,1),salmon:Float32Array.of(.98,.502,.447,1),sandybrown:Float32Array.of(.957, 143 | .643,.376,1),seagreen:Float32Array.of(.18,.545,.341,1),seashell:Float32Array.of(1,.961,.933,1),sienna:Float32Array.of(.627,.322,.176,1),silver:Float32Array.of(.753,.753,.753,1),skyblue:Float32Array.of(.529,.808,.922,1),slateblue:Float32Array.of(.416,.353,.804,1),slategray:Float32Array.of(.439,.502,.565,1),slategrey:Float32Array.of(.439,.502,.565,1),snow:Float32Array.of(1,.98,.98,1),springgreen:Float32Array.of(0,1,.498,1),steelblue:Float32Array.of(.275,.51,.706,1),tan:Float32Array.of(.824,.706,.549, 144 | 1),teal:Float32Array.of(0,.502,.502,1),thistle:Float32Array.of(.847,.749,.847,1),tomato:Float32Array.of(1,.388,.278,1),transparent:Float32Array.of(0,0,0,0),turquoise:Float32Array.of(.251,.878,.816,1),violet:Float32Array.of(.933,.51,.933,1),wheat:Float32Array.of(.961,.871,.702,1),white:Float32Array.of(1,1,1,1),whitesmoke:Float32Array.of(.961,.961,.961,1),yellow:Float32Array.of(1,1,0,1),yellowgreen:Float32Array.of(.604,.804,.196,1)};a._testing.parseColor=g;a._testing.colorToString=d;var Aa=RegExp("(italic|oblique|normal|)\\s*(small-caps|normal|)\\s*(bold|bolder|lighter|[1-9]00|normal|)\\s*([\\d\\.]+)(px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q)(.+)"), 145 | ea={"Noto Mono":{"*":null},monospace:{"*":null}};a._testing.parseFontString=m;a.MakeCanvas=function(F,k){return(F=a.MakeSurface(F,k))?new y(F):null};a.ImageData=function(){if(2===arguments.length){var F=arguments[0],k=arguments[1];return new I(new Uint8ClampedArray(4*F*k),F,k)}if(3===arguments.length){var p=arguments[0];if(p.prototype.constructor!==Uint8ClampedArray)throw"bytes must be given as a Uint8ClampedArray";F=arguments[1];k=arguments[2];if(p%4)throw"bytes must be given in a multiple of 4"; 146 | if(p%F)throw"bytes must divide evenly by width";if(k&&k!==p/(4*F))throw"invalid height given";return new I(p,F,p/(4*F))}throw"invalid number of arguments - takes 2 or 3, saw "+arguments.length;}})()})(t);var va=da({},t),wa="./this.program",xa=(a,b)=>{throw b;},ya="object"===typeof window,za="function"===typeof importScripts,Ba="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node,Ca="",Da,Ea,Fa,fs,Ga,Ja; 147 | if(Ba)Ca=za?require("path").dirname(Ca)+"/":__dirname+"/",Ja=()=>{Ga||(fs=require("fs"),Ga=require("path"))},Da=function(a,b){Ja();a=Ga.normalize(a);return fs.readFileSync(a,b?null:"utf8")},Fa=a=>{a=Da(a,!0);a.buffer||(a=new Uint8Array(a));return a},Ea=(a,b,c)=>{Ja();a=Ga.normalize(a);fs.readFile(a,function(f,h){f?c(f):b(h.buffer)})},1{if(noExitRuntime||0{var b=new XMLHttpRequest;b.open("GET",a, 149 | !1);b.send(null);return b.responseText},za&&(Fa=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),Ea=(a,b,c)=>{var f=new XMLHttpRequest;f.open("GET",a,!0);f.responseType="arraybuffer";f.onload=()=>{200==f.status||0==f.status&&f.response?b(f.response):c()};f.onerror=c;f.send(null)};var Na=t.print||console.log.bind(console),Ma=t.printErr||console.warn.bind(console);da(t,va);va=null;t.thisProgram&&(wa=t.thisProgram); 150 | t.quit&&(xa=t.quit);var Pa=0,Qa;t.wasmBinary&&(Qa=t.wasmBinary);var noExitRuntime=t.noExitRuntime||!0;"object"!==typeof WebAssembly&&Ra("no native wasm support detected");var Sa,Ua=!1,Va="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0; 151 | function Wa(a,b,c){var f=b+c;for(c=b;a[c]&&!(c>=f);)++c;if(16h?f+=String.fromCharCode(h):(h-=65536,f+=String.fromCharCode(55296|h>>10,56320|h&1023))}}else f+=String.fromCharCode(h)}return f}function Xa(a,b){return a?Wa(G,a,b):""} 152 | function sa(a,b,c,f){if(!(0=n){var q=a.charCodeAt(++l);n=65536+((n&1023)<<10)|q&1023}if(127>=n){if(c>=f)break;b[c++]=n}else{if(2047>=n){if(c+1>=f)break;b[c++]=192|n>>6}else{if(65535>=n){if(c+2>=f)break;b[c++]=224|n>>12}else{if(c+3>=f)break;b[c++]=240|n>>18;b[c++]=128|n>>12&63}b[c++]=128|n>>6&63}b[c++]=128|n&63}}b[c]=0;return c-h} 153 | function ra(a){for(var b=0,c=0;c=f&&(f=65536+((f&1023)<<10)|a.charCodeAt(++c)&1023);127>=f?++b:b=2047>=f?b+2:65535>=f?b+3:b+4}return b}var Ya="undefined"!==typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function ab(a,b){var c=a>>1;for(var f=c+b/2;!(c>=f)&&bb[c];)++c;c<<=1;if(32=b/2);++f){var h=cb[a+2*f>>1];if(0==h)break;c+=String.fromCharCode(h)}return c} 154 | function db(a,b,c){void 0===c&&(c=2147483647);if(2>c)return 0;c-=2;var f=b;c=c<2*a.length?c/2:a.length;for(var h=0;h>1]=a.charCodeAt(h),b+=2;cb[b>>1]=0;return b-f}function eb(a){return 2*a.length}function jb(a,b){for(var c=0,f="";!(c>=b/4);){var h=O[a+4*c>>2];if(0==h)break;++c;65536<=h?(h-=65536,f+=String.fromCharCode(55296|h>>10,56320|h&1023)):f+=String.fromCharCode(h)}return f} 155 | function kb(a,b,c){void 0===c&&(c=2147483647);if(4>c)return 0;var f=b;c=f+c-4;for(var h=0;h=l){var n=a.charCodeAt(++h);l=65536+((l&1023)<<10)|n&1023}O[b>>2]=l;b+=4;if(b+4>c)break}O[b>>2]=0;return b-f}function lb(a){for(var b=0,c=0;c=f&&++c;b+=4}return b}var mb,nb,G,cb,bb,O,ob,U,pb; 156 | function qb(){var a=Sa.buffer;mb=a;t.HEAP8=nb=new Int8Array(a);t.HEAP16=cb=new Int16Array(a);t.HEAP32=O=new Int32Array(a);t.HEAPU8=G=new Uint8Array(a);t.HEAPU16=bb=new Uint16Array(a);t.HEAPU32=ob=new Uint32Array(a);t.HEAPF32=U=new Float32Array(a);t.HEAPF64=pb=new Float64Array(a)}var rb,sb=[],tb=[],ub=[],La=0;function vb(){var a=t.preRun.shift();sb.unshift(a)}var wb=0,xb=null,zb=null;t.preloadedImages={};t.preloadedAudios={}; 157 | function Ra(a){if(t.onAbort)t.onAbort(a);a="Aborted("+a+")";Ma(a);Ua=!0;a=new WebAssembly.RuntimeError(a+". Build with -s ASSERTIONS=1 for more info.");ha(a);throw a;}function Ab(){return Bb.startsWith("data:application/octet-stream;base64,")}var Bb;Bb="canvaskit.wasm";if(!Ab()){var Cb=Bb;Bb=t.locateFile?t.locateFile(Cb,Ca):Ca+Cb}function Db(){var a=Bb;try{if(a==Bb&&Qa)return new Uint8Array(Qa);if(Fa)return Fa(a);throw"both async and sync fetching of the wasm failed";}catch(b){Ra(b)}} 158 | function Eb(){if(!Qa&&(ya||za)){if("function"===typeof fetch&&!Bb.startsWith("file://"))return fetch(Bb,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+Bb+"'";return a.arrayBuffer()}).catch(function(){return Db()});if(Ea)return new Promise(function(a,b){Ea(Bb,function(c){a(new Uint8Array(c))},b)})}return Promise.resolve().then(function(){return Db()})} 159 | function Fb(a){for(;0>2]=b};this.jg=function(b){O[this.Qd+8>>2]=b};this.kg=function(){O[this.Qd>>2]=0};this.ig=function(){nb[this.Qd+12>>0]=0};this.lg=function(){nb[this.Qd+13>>0]=0};this.Xf=function(b,c){this.mg(b);this.jg(c);this.kg();this.ig();this.lg()}}var Ib=0,Jb={},Kb=[null,[],[]],Lb={},Mb={};function Nb(a){for(;a.length;){var b=a.pop();a.pop()(b)}}function Ob(a){return this.fromWireType(ob[a>>2])}var Pb={},Qb={},Rb={}; 161 | function Sb(a){if(void 0===a)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?"_"+a:a}function Tb(a,b){a=Sb(a);return function(){null;return b.apply(this,arguments)}} 162 | function Ub(a){var b=Error,c=Tb(a,function(f){this.name=a;this.message=f;f=Error(f).stack;void 0!==f&&(this.stack=this.toString()+"\n"+f.replace(/^Error(:[^\n]*)?\n/,""))});c.prototype=Object.create(b.prototype);c.prototype.constructor=c;c.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return c}var Vb=void 0;function Wb(a){throw new Vb(a);} 163 | function Xb(a,b,c){function f(q){q=c(q);q.length!==a.length&&Wb("Mismatched type converter count");for(var w=0;wb,a;jc=new FinalizationGroup(function(b){for(var c=b.next();!c.done;c=b.next())c=c.value,c.Qd?lc(c):console.warn("object already deleted: "+c.Qd)});mc=b=>{jc.register(b,b.Ld,b.Ld);return b};kc=b=>{jc.unregister(b.Ld)};return mc(a)}var nc=void 0,oc=[];function pc(){for(;oc.length;){var a=oc.pop();a.Ld.De=!1;a["delete"]()}}function qc(){} 167 | var rc={};function sc(a,b,c){if(void 0===a[b].Zd){var f=a[b];a[b]=function(){a[b].Zd.hasOwnProperty(arguments.length)||X("Function '"+c+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+a[b].Zd+")!");return a[b].Zd[arguments.length].apply(this,arguments)};a[b].Zd=[];a[b].Zd[f.Be]=f}} 168 | function tc(a,b,c){t.hasOwnProperty(a)?((void 0===c||void 0!==t[a].Zd&&void 0!==t[a].Zd[c])&&X("Cannot register public name '"+a+"' twice"),sc(t,a,a),t.hasOwnProperty(c)&&X("Cannot register multiple overloads of a function with the same number of arguments ("+c+")!"),t[a].Zd[c]=b):(t[a]=b,void 0!==c&&(t[a].Fg=c))}function uc(a,b,c,f,h,l,n,q){this.name=a;this.constructor=b;this.Ee=c;this.le=f;this.ie=h;this.Pf=l;this.Pe=n;this.Jf=q;this.fg=[]} 169 | function vc(a,b,c){for(;b!==c;)b.Pe||X("Expected null or instance of "+c.name+", got an instance of "+b.name),a=b.Pe(a),b=b.ie;return a}function wc(a,b){if(null===b)return this.gf&&X("null is not a valid "+this.name),0;b.Ld||X('Cannot pass "'+xc(b)+'" as a '+this.name);b.Ld.Qd||X("Cannot pass deleted object as a pointer of type "+this.name);return vc(b.Ld.Qd,b.Ld.Xd.Sd,this.Sd)} 170 | function yc(a,b){if(null===b){this.gf&&X("null is not a valid "+this.name);if(this.Ue){var c=this.hf();null!==a&&a.push(this.le,c);return c}return 0}b.Ld||X('Cannot pass "'+xc(b)+'" as a '+this.name);b.Ld.Qd||X("Cannot pass deleted object as a pointer of type "+this.name);!this.Te&&b.Ld.Xd.Te&&X("Cannot convert argument of type "+(b.Ld.ge?b.Ld.ge.name:b.Ld.Xd.name)+" to parameter type "+this.name);c=vc(b.Ld.Qd,b.Ld.Xd.Sd,this.Sd);if(this.Ue)switch(void 0===b.Ld.$d&&X("Passing raw pointer to smart pointer is illegal"), 171 | this.qg){case 0:b.Ld.ge===this?c=b.Ld.$d:X("Cannot convert argument of type "+(b.Ld.ge?b.Ld.ge.name:b.Ld.Xd.name)+" to parameter type "+this.name);break;case 1:c=b.Ld.$d;break;case 2:if(b.Ld.ge===this)c=b.Ld.$d;else{var f=b.clone();c=this.gg(c,zc(function(){f["delete"]()}));null!==a&&a.push(this.le,c)}break;default:X("Unsupporting sharing policy")}return c} 172 | function Ac(a,b){if(null===b)return this.gf&&X("null is not a valid "+this.name),0;b.Ld||X('Cannot pass "'+xc(b)+'" as a '+this.name);b.Ld.Qd||X("Cannot pass deleted object as a pointer of type "+this.name);b.Ld.Xd.Te&&X("Cannot convert argument of type "+b.Ld.Xd.name+" to parameter type "+this.name);return vc(b.Ld.Qd,b.Ld.Xd.Sd,this.Sd)}function Bc(a,b,c){if(b===c)return a;if(void 0===c.ie)return null;a=Bc(a,b,c.ie);return null===a?null:c.Jf(a)}var Cc={}; 173 | function Dc(a,b){for(void 0===b&&X("ptr should not be undefined");a.ie;)b=a.Pe(b),a=a.ie;return Cc[b]}function Ec(a,b){b.Xd&&b.Qd||Wb("makeClassHandle requires ptr and ptrType");!!b.ge!==!!b.$d&&Wb("Both smartPtrType and smartPtr must be specified");b.count={value:1};return mc(Object.create(a,{Ld:{value:b}}))} 174 | function Fc(a,b,c,f,h,l,n,q,w,x,J){this.name=a;this.Sd=b;this.gf=c;this.Te=f;this.Ue=h;this.eg=l;this.qg=n;this.vf=q;this.hf=w;this.gg=x;this.le=J;h||void 0!==b.ie?this.toWireType=yc:(this.toWireType=f?wc:Ac,this.fe=null)}function Gc(a,b,c){t.hasOwnProperty(a)||Wb("Replacing nonexistant public symbol");void 0!==t[a].Zd&&void 0!==c?t[a].Zd[c]=b:(t[a]=b,t[a].Be=c)} 175 | function Hc(a,b){var c=[];return function(){c.length=arguments.length;for(var f=0;fl&&X("argTypes array size mismatch! Must at least get return value and 'this' types!");var n=null!==b[1]&&null!==c,q=!1;for(c=1;c>2)+f]);return c}var Xc=[],Yc=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Zc(a){4>2])};case 3:return function(c){return this.fromWireType(pb[c>>3])};default:throw new TypeError("Unknown float type: "+a);}} 181 | function dd(a,b,c){switch(b){case 0:return c?function(f){return nb[f]}:function(f){return G[f]};case 1:return c?function(f){return cb[f>>1]}:function(f){return bb[f>>1]};case 2:return c?function(f){return O[f>>2]}:function(f){return ob[f>>2]};default:throw new TypeError("Unknown integer type: "+a);}}var ed={};function fd(a){var b=ed[a];return void 0===b?gc(a):b}var gd=[]; 182 | function hd(){function a(b){b.$$$embind_global$$$=b;var c="object"===typeof $$$embind_global$$$&&b.$$$embind_global$$$===b;c||delete b.$$$embind_global$$$;return c}if("object"===typeof globalThis)return globalThis;if("object"===typeof $$$embind_global$$$)return $$$embind_global$$$;"object"===typeof global&&a(global)?$$$embind_global$$$=global:"object"===typeof self&&a(self)&&($$$embind_global$$$=self);if("object"===typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object."); 183 | }function jd(a){var b=gd.length;gd.push(a);return b}function kd(a,b){for(var c=Array(a),f=0;f>2)+f],"parameter "+f);return c}var ld=[];function md(a){var b=Array(a+1);return function(c,f,h){b[0]=c;for(var l=0;l>2)+l],"parameter "+l);b[l+1]=n.readValueFromPointer(h);h+=n.argPackAdvance}c=new (c.bind.apply(c,b));return zc(c)}}var nd={},od;od=Ba?()=>{var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:()=>performance.now(); 184 | function pd(a){var b=a.getExtension("ANGLE_instanced_arrays");b&&(a.vertexAttribDivisor=function(c,f){b.vertexAttribDivisorANGLE(c,f)},a.drawArraysInstanced=function(c,f,h,l){b.drawArraysInstancedANGLE(c,f,h,l)},a.drawElementsInstanced=function(c,f,h,l,n){b.drawElementsInstancedANGLE(c,f,h,l,n)})} 185 | function qd(a){var b=a.getExtension("OES_vertex_array_object");b&&(a.createVertexArray=function(){return b.createVertexArrayOES()},a.deleteVertexArray=function(c){b.deleteVertexArrayOES(c)},a.bindVertexArray=function(c){b.bindVertexArrayOES(c)},a.isVertexArray=function(c){return b.isVertexArrayOES(c)})}function rd(a){var b=a.getExtension("WEBGL_draw_buffers");b&&(a.drawBuffers=function(c,f){b.drawBuffersWEBGL(c,f)})} 186 | var sd=1,td=[],ud=[],vd=[],wd=[],la=[],xd=[],yd=[],qa=[],zd=[],Ad=[],Bd={},Cd={},Dd=4;function Ed(a){Hd||(Hd=a)}function ka(a){for(var b=sd++,c=a.length;ca.version||!b.qf)b.qf=b.getExtension("EXT_disjoint_timer_query");b.Eg=b.getExtension("WEBGL_multi_draw");(b.getSupportedExtensions()||[]).forEach(function(c){c.includes("lose_context")||c.includes("debug")||b.getExtension(c)})}} 189 | var v,Hd,Kd=[];function Ld(a,b,c,f){for(var h=0;h>2]=n}} 190 | function Md(a,b){if(b){var c=void 0;switch(a){case 36346:c=1;break;case 36344:return;case 34814:case 36345:c=0;break;case 34466:var f=Y.getParameter(34467);c=f?f.length:0;break;case 33309:if(2>v.version){Ed(1282);return}c=2*(Y.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(2>v.version){Ed(1280);return}c=33307==a?3:0}if(void 0===c)switch(f=Y.getParameter(a),typeof f){case "number":c=f;break;case "boolean":c=f?1:0;break;case "string":Ed(1280);return;case "object":if(null===f)switch(a){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:c= 191 | 0;break;default:Ed(1280);return}else{if(f instanceof Float32Array||f instanceof Uint32Array||f instanceof Int32Array||f instanceof Array){for(a=0;a>2]=f[a];return}try{c=f.name|0}catch(h){Ed(1280);Ma("GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter("+a+")! (error: "+h+")");return}}break;default:Ed(1280);Ma("GL_INVALID_ENUM in glGet0v: Native code calling glGet0v("+a+") and it returns "+f+" of type "+typeof f+"!");return}O[b>>2]=c}else Ed(1281)} 192 | function Nd(a){var b=ra(a)+1,c=Od(b);sa(a,G,c,b);return c}function Pd(a){return"]"==a.slice(-1)&&a.lastIndexOf("[")}function Qd(a){a-=5120;return 0==a?nb:1==a?G:2==a?cb:4==a?O:6==a?U:5==a||28922==a||28520==a||30779==a||30782==a?ob:bb}function Rd(a,b,c,f,h){a=Qd(a);var l=31-Math.clz32(a.BYTES_PER_ELEMENT),n=Dd;return a.subarray(h>>l,h+f*(c*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[b-6402]||1)*(1<>l)} 193 | function Z(a){var b=Y.Gf;if(b){var c=b.Oe[a];"number"===typeof c&&(b.Oe[a]=c=Y.getUniformLocation(b,b.wf[a]+(0oa?-1:0=n(S,A)?0>=n(L,A)?A.getFullYear()+1:A.getFullYear():A.getFullYear()-1}var x=O[f+40>>2];f={yg:O[f>>2],xg:O[f+4>>2],Ye:O[f+8>>2],Ne:O[f+12>>2],Fe:O[f+16>>2],be:O[f+20>>2],Ze:O[f+24>>2],$e:O[f+28>>2],Ig:O[f+32>>2],wg:O[f+ 198 | 36>>2],zg:x?Xa(x):""};c=Xa(c);x={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var J in x)c=c.replace(new RegExp(J,"g"),x[J]);var K="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), 199 | Q="January February March April May June July August September October November December".split(" ");x={"%a":function(A){return K[A.Ze].substring(0,3)},"%A":function(A){return K[A.Ze]},"%b":function(A){return Q[A.Fe].substring(0,3)},"%B":function(A){return Q[A.Fe]},"%C":function(A){return l((A.be+1900)/100|0,2)},"%d":function(A){return l(A.Ne,2)},"%e":function(A){return h(A.Ne,2," ")},"%g":function(A){return w(A).toString().substring(2)},"%G":function(A){return w(A)},"%H":function(A){return l(A.Ye, 200 | 2)},"%I":function(A){A=A.Ye;0==A?A=12:12A.Ye?"AM":"PM"},"%S":function(A){return l(A.yg,2)},"%t":function(){return"\t"},"%u":function(A){return A.Ze||7},"%U":function(A){var L=new Date(A.be+1900,0,1),S=0===L.getDay()?L:ae(L,7-L.getDay());A=new Date(A.be+1900,A.Fe,A.Ne);return 0> 201 | n(S,A)?l(Math.ceil((31-S.getDate()+(Yd(Xd(A.getFullYear())?Zd:$d,A.getMonth()-1)-31)+A.getDate())/7),2):0===n(S,L)?"01":"00"},"%V":function(A){var L=new Date(A.be+1901,0,4),S=q(new Date(A.be+1900,0,4));L=q(L);var T=ae(new Date(A.be+1900,0,1),A.$e);return 0>n(T,S)?"53":0>=n(L,T)?"01":l(Math.ceil((S.getFullYear()n(S,A)?l(Math.ceil((31-S.getDate()+(Yd(Xd(A.getFullYear())?Zd:$d,A.getMonth()-1)-31)+A.getDate())/7),2):0===n(S,L)?"01":"00"},"%y":function(A){return(A.be+1900).toString().substring(2)},"%Y":function(A){return A.be+1900},"%z":function(A){A=A.wg;var L=0<=A;A=Math.abs(A)/60;return(L?"+":"-")+String("0000"+(A/60*100+A%60)).slice(-4)},"%Z":function(A){return A.zg},"%%":function(){return"%"}};for(J in x)c.includes(J)&&(c=c.replace(new RegExp(J,"g"),x[J](f)));J=ce(c); 203 | if(J.length>b)return 0;nb.set(J,a);return J.length-1}Vb=t.InternalError=Ub("InternalError");for(var de=Array(256),ee=0;256>ee;++ee)de[ee]=String.fromCharCode(ee);fc=de;hc=t.BindingError=Ub("BindingError");qc.prototype.isAliasOf=function(a){if(!(this instanceof qc&&a instanceof qc))return!1;var b=this.Ld.Xd.Sd,c=this.Ld.Qd,f=a.Ld.Xd.Sd;for(a=a.Ld.Qd;b.ie;)c=b.Pe(c),b=b.ie;for(;f.ie;)a=f.Pe(a),f=f.ie;return b===f&&c===a}; 204 | qc.prototype.clone=function(){this.Ld.Qd||ic(this);if(this.Ld.Me)return this.Ld.count.value+=1,this;var a=mc,b=Object,c=b.create,f=Object.getPrototypeOf(this),h=this.Ld;a=a(c.call(b,f,{Ld:{value:{count:h.count,De:h.De,Me:h.Me,Qd:h.Qd,Xd:h.Xd,$d:h.$d,ge:h.ge}}}));a.Ld.count.value+=1;a.Ld.De=!1;return a};qc.prototype["delete"]=function(){this.Ld.Qd||ic(this);this.Ld.De&&!this.Ld.Me&&X("Object already scheduled for deletion");kc(this);lc(this.Ld);this.Ld.Me||(this.Ld.$d=void 0,this.Ld.Qd=void 0)}; 205 | qc.prototype.isDeleted=function(){return!this.Ld.Qd};qc.prototype.deleteLater=function(){this.Ld.Qd||ic(this);this.Ld.De&&!this.Ld.Me&&X("Object already scheduled for deletion");oc.push(this);1===oc.length&&nc&&nc(pc);this.Ld.De=!0;return this};Fc.prototype.Qf=function(a){this.vf&&(a=this.vf(a));return a};Fc.prototype.nf=function(a){this.le&&this.le(a)};Fc.prototype.argPackAdvance=8;Fc.prototype.readValueFromPointer=Ob;Fc.prototype.deleteObject=function(a){if(null!==a)a["delete"]()}; 206 | Fc.prototype.fromWireType=function(a){function b(){return this.Ue?Ec(this.Sd.Ee,{Xd:this.eg,Qd:c,ge:this,$d:a}):Ec(this.Sd.Ee,{Xd:this,Qd:a})}var c=this.Qf(a);if(!c)return this.nf(a),null;var f=Dc(this.Sd,c);if(void 0!==f){if(0===f.Ld.count.value)return f.Ld.Qd=c,f.Ld.$d=a,f.clone();f=f.clone();this.nf(a);return f}f=this.Sd.Pf(c);f=rc[f];if(!f)return b.call(this);f=this.Te?f.Ef:f.pointerType;var h=Bc(c,this.Sd,f.Sd);return null===h?b.call(this):this.Ue?Ec(f.Sd.Ee,{Xd:f,Qd:h,ge:this,$d:a}):Ec(f.Sd.Ee, 207 | {Xd:f,Qd:h})};t.getInheritedInstanceCount=function(){return Object.keys(Cc).length};t.getLiveInheritedInstances=function(){var a=[],b;for(b in Cc)Cc.hasOwnProperty(b)&&a.push(Cc[b]);return a};t.flushPendingDeletes=pc;t.setDelayFunction=function(a){nc=a;oc.length&&nc&&nc(pc)};Qc=t.UnboundTypeError=Ub("UnboundTypeError");t.count_emval_handles=function(){for(var a=0,b=5;bfe;++fe)Kd.push(Array(fe));var ge=new Float32Array(288);for(fe=0;288>fe;++fe)Sd[fe]=ge.subarray(0,fe+1);var he=new Int32Array(288);for(fe=0;288>fe;++fe)Td[fe]=he.subarray(0,fe+1);function ce(a){var b=Array(ra(a)+1);sa(a,b,0,b.length);return b} 209 | var ze={Lb:function(a){return Od(a+16)+16},Eb:function(a,b,c){(new Hb(a)).Xf(b,c);Ib++;throw a;},P:function(){return 0},zb:function(){},xb:function(){},Cb:function(){return 0},wb:function(){},tb:function(a,b,c,f,h,l){l<<=12;if(0!==(f&16)&&0!==a%65536)b=-28;else if(0!==(f&32)){a=65536*Math.ceil(b/65536);var n=ie(65536,a);n?(G.fill(0,n,n+a),a=n):a=0;a?(Jb[a]={cg:a,bg:b,Df:!0,fd:h,Gg:c,flags:f,offset:l},b=a):b=-48}else b=-52;return b},sb:function(a,b){var c=Jb[a];0!==b&&c?(b===c.bg&&(Jb[a]=null,c.Df&& 210 | Tc(c.cg)),a=0):a=-28;return a},Q:function(){},yb:function(){},x:function(a){var b=Mb[a];delete Mb[a];var c=b.hf,f=b.le,h=b.rf,l=h.map(function(n){return n.Uf}).concat(h.map(function(n){return n.og}));Xb([a],l,function(n){var q={};h.forEach(function(w,x){var J=n[x],K=w.Sf,Q=w.Tf,A=n[x+h.length],L=w.ng,S=w.pg;q[w.Lf]={read:function(T){return J.fromWireType(K(Q,T))},write:function(T,oa){var ta=[];L(S,T,A.toWireType(ta,oa));Nb(ta)}}});return[{name:b.name,fromWireType:function(w){var x={},J;for(J in q)x[J]= 211 | q[J].read(w);f(w);return x},toWireType:function(w,x){for(var J in q)if(!(J in x))throw new TypeError('Missing field: "'+J+'"');var K=c();for(J in q)q[J].write(K,x[J]);null!==w&&w.push(f,K);return K},argPackAdvance:8,readValueFromPointer:Ob,fe:f}]})},mb:function(){},Fb:function(a,b,c,f,h){var l=ec(c);b=gc(b);dc(a,{name:b,fromWireType:function(n){return!!n},toWireType:function(n,q){return q?f:h},argPackAdvance:8,readValueFromPointer:function(n){if(1===c)var q=nb;else if(2===c)q=cb;else if(4===c)q= 212 | O;else throw new TypeError("Unknown boolean type size: "+b);return this.fromWireType(q[n>>l])},fe:null})},l:function(a,b,c,f,h,l,n,q,w,x,J,K,Q){J=gc(J);l=Pc(h,l);q&&(q=Pc(n,q));x&&(x=Pc(w,x));Q=Pc(K,Q);var A=Sb(J);tc(A,function(){Uc("Cannot construct "+J+" due to unbound types",[f])});Xb([a,b,c],f?[f]:[],function(L){L=L[0];if(f){var S=L.Sd;var T=S.Ee}else T=qc.prototype;L=Tb(A,function(){if(Object.getPrototypeOf(this)!==oa)throw new hc("Use 'new' to construct "+J);if(void 0===ta.oe)throw new hc(J+ 213 | " has no accessible constructor");var hb=ta.oe[arguments.length];if(void 0===hb)throw new hc("Tried to invoke ctor of "+J+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(ta.oe).toString()+") parameters instead!");return hb.apply(this,arguments)});var oa=Object.create(T,{constructor:{value:L}});L.prototype=oa;var ta=new uc(J,L,oa,Q,S,l,q,x);S=new Fc(J,ta,!0,!1,!1);T=new Fc(J+"*",ta,!1,!1,!1);var gb=new Fc(J+" const*",ta,!1,!0,!1);rc[a]={pointerType:T,Ef:gb};Gc(A, 214 | L);return[S,T,gb]})},e:function(a,b,c,f,h,l,n){var q=Wc(c,f);b=gc(b);l=Pc(h,l);Xb([],[a],function(w){function x(){Uc("Cannot call "+J+" due to unbound types",q)}w=w[0];var J=w.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);var K=w.Sd.constructor;void 0===K[b]?(x.Be=c-1,K[b]=x):(sc(K,b,J),K[b].Zd[c-1]=x);Xb([],q,function(Q){Q=[Q[0],null].concat(Q.slice(1));Q=Vc(J,Q,null,l,n);void 0===K[b].Zd?(Q.Be=c-1,K[b]=Q):K[b].Zd[c-1]=Q;return[]});return[]})},u:function(a,b,c,f,h,l){0{Uc("Cannot construct "+q.name+" due to unbound types",n)};Xb([],n,function(x){x.splice(1,0,null);q.Sd.oe[b-1]=Vc(w,x,null,h, 216 | l);return[]});return[]})},d:function(a,b,c,f,h,l,n,q){var w=Wc(c,f);b=gc(b);l=Pc(h,l);Xb([],[a],function(x){function J(){Uc("Cannot call "+K+" due to unbound types",w)}x=x[0];var K=x.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);q&&x.Sd.fg.push(b);var Q=x.Sd.Ee,A=Q[b];void 0===A||void 0===A.Zd&&A.className!==x.name&&A.Be===c-2?(J.Be=c-2,J.className=x.name,Q[b]=J):(sc(Q,b,K),Q[b].Zd[c-2]=J);Xb([],w,function(L){L=Vc(K,L,x,l,n);void 0===Q[b].Zd?(L.Be=c-2,Q[b]=L):Q[b].Zd[c-2]=L;return[]}); 217 | return[]})},V:function(a,b,c){a=gc(a);Xb([],[b],function(f){f=f[0];t[a]=f.fromWireType(c);return[]})},Db:function(a,b){b=gc(b);dc(a,{name:b,fromWireType:function(c){var f=$c(c);Zc(c);return f},toWireType:function(c,f){return zc(f)},argPackAdvance:8,readValueFromPointer:Ob,fe:null})},k:function(a,b,c,f){function h(){}c=ec(c);b=gc(b);h.values={};dc(a,{name:b,constructor:h,fromWireType:function(l){return this.constructor.values[l]},toWireType:function(l,n){return n.value},argPackAdvance:8,readValueFromPointer:ad(b, 218 | c,f),fe:null});tc(b,h)},j:function(a,b,c){var f=bd(a,"enum");b=gc(b);a=f.constructor;f=Object.create(f.constructor.prototype,{value:{value:c},constructor:{value:Tb(f.name+"_"+b,function(){})}});a.values[c]=f;a[b]=f},S:function(a,b,c){c=ec(c);b=gc(b);dc(a,{name:b,fromWireType:function(f){return f},toWireType:function(f,h){return h},argPackAdvance:8,readValueFromPointer:cd(b,c),fe:null})},t:function(a,b,c,f,h,l){var n=Wc(b,c);a=gc(a);h=Pc(f,h);tc(a,function(){Uc("Cannot call "+a+" due to unbound types", 219 | n)},b-1);Xb([],n,function(q){q=[q[0],null].concat(q.slice(1));Gc(a,Vc(a,q,null,h,l),b-1);return[]})},w:function(a,b,c,f,h){b=gc(b);-1===h&&(h=4294967295);h=ec(c);var l=q=>q;if(0===f){var n=32-8*c;l=q=>q<>>n}c=b.includes("unsigned")?function(q,w){return w>>>0}:function(q,w){return w};dc(a,{name:b,fromWireType:l,toWireType:c,argPackAdvance:8,readValueFromPointer:dd(b,h,0!==f),fe:null})},p:function(a,b,c){function f(l){l>>=2;var n=ob;return new h(mb,n[l+1],n[l])}var h=[Int8Array,Uint8Array,Int16Array, 220 | Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][b];c=gc(c);dc(a,{name:c,fromWireType:f,argPackAdvance:8,readValueFromPointer:f},{Wf:!0})},o:function(a,b,c,f,h,l,n,q,w,x,J,K){c=gc(c);l=Pc(h,l);q=Pc(n,q);x=Pc(w,x);K=Pc(J,K);Xb([a],[b],function(Q){Q=Q[0];return[new Fc(c,Q.Sd,!1,!1,!0,Q,f,l,q,x,K)]})},R:function(a,b){b=gc(b);var c="std::string"===b;dc(a,{name:b,fromWireType:function(f){var h=ob[f>>2];if(c)for(var l=f+4,n=0;n<=h;++n){var q=f+4+n;if(n==h||0==G[q]){l=Xa(l,q-l);if(void 0=== 221 | w)var w=l;else w+=String.fromCharCode(0),w+=l;l=q+1}}else{w=Array(h);for(n=0;nra(h):()=>h.length)(),q=Od(4+n+1);ob[q>>2]=n;if(c&&l)sa(h,G,q+4,n+1);else if(l)for(l=0;lbb;var q=1}else 4===b&&(f=jb,h=kb,l=lb,n=()=>ob,q=2);dc(a,{name:c,fromWireType:function(w){for(var x=ob[w>>2],J=n(),K,Q=w+4,A=0;A<=x;++A){var L=w+4+A*b;if(A==x||0==J[L>>q])Q=f(Q,L-Q),void 0===K?K=Q:(K+=String.fromCharCode(0), 223 | K+=Q),Q=L+b}Tc(w);return K},toWireType:function(w,x){"string"!==typeof x&&X("Cannot pass non-string to C++ string type "+c);var J=l(x),K=Od(4+J+b);ob[K>>2]=J>>q;h(x,K+4,J+b);null!==w&&w.push(Tc,K);return K},argPackAdvance:8,readValueFromPointer:Ob,fe:function(w){Tc(w)}})},y:function(a,b,c,f,h,l){Mb[a]={name:gc(b),hf:Pc(c,f),le:Pc(h,l),rf:[]}},g:function(a,b,c,f,h,l,n,q,w,x){Mb[a].rf.push({Lf:gc(b),Uf:c,Sf:Pc(f,h),Tf:l,og:n,ng:Pc(q,w),pg:x})},Gb:function(a,b){b=gc(b);dc(a,{Zf:!0,name:b,argPackAdvance:0, 224 | fromWireType:function(){},toWireType:function(){}})},pb:function(){throw"longjmp";},A:function(a,b,c){a=$c(a);b=bd(b,"emval::as");var f=[],h=zc(f);O[c>>2]=h;return b.toWireType(f,a)},M:function(a,b,c,f,h){a=gd[a];b=$c(b);c=fd(c);var l=[];O[f>>2]=zc(l);return a(b,c,l,h)},B:function(a,b,c,f){a=gd[a];b=$c(b);c=fd(c);a(b,c,null,f)},D:Zc,Bb:function(a){if(0===a)return zc(hd());a=fd(a);return zc(hd()[a])},z:function(a,b){var c=kd(a,b),f=c[0];b=f.name+"_$"+c.slice(1).map(function(n){return n.name}).join("_")+ 225 | "$";var h=ld[b];if(void 0!==h)return h;var l=Array(a-1);h=jd((n,q,w,x)=>{for(var J=0,K=0;K>2]=28,-1;O[b>>2]=a/1E3|0;O[b+4>>2]=a%1E3*1E6|0;return 0},_c:function(a){Y.activeTexture(a)},$c:function(a,b){Y.attachShader(ud[a],xd[b])},ad:function(a,b,c){Y.bindAttribLocation(ud[a], 227 | b,Xa(c))},Y:function(a,b){35051==a?Y.ff=b:35052==a&&(Y.Ce=b);Y.bindBuffer(a,td[b])},X:function(a,b){Y.bindFramebuffer(a,vd[b])},cc:function(a,b){Y.bindRenderbuffer(a,wd[b])},Qb:function(a,b){Y.bindSampler(a,zd[b])},Z:function(a,b){Y.bindTexture(a,la[b])},wc:function(a){Y.bindVertexArray(yd[a])},zc:function(a){Y.bindVertexArray(yd[a])},_:function(a,b,c,f){Y.blendColor(a,b,c,f)},$:function(a){Y.blendEquation(a)},aa:function(a,b){Y.blendFunc(a,b)},Xb:function(a,b,c,f,h,l,n,q,w,x){Y.blitFramebuffer(a, 228 | b,c,f,h,l,n,q,w,x)},ba:function(a,b,c,f){2<=v.version?c?Y.bufferData(a,G,f,c,b):Y.bufferData(a,b,f):Y.bufferData(a,c?G.subarray(c,c+b):b,f)},ca:function(a,b,c,f){2<=v.version?Y.bufferSubData(a,b,G,f,c):Y.bufferSubData(a,b,G.subarray(f,f+c))},dc:function(a){return Y.checkFramebufferStatus(a)},L:function(a){Y.clear(a)},W:function(a,b,c,f){Y.clearColor(a,b,c,f)},O:function(a){Y.clearStencil(a)},db:function(a,b,c,f){return Y.clientWaitSync(Ad[a],b,(c>>>0)+4294967296*f)},da:function(a,b,c,f){Y.colorMask(!!a, 229 | !!b,!!c,!!f)},ea:function(a){Y.compileShader(xd[a])},fa:function(a,b,c,f,h,l,n,q){2<=v.version?Y.Ce?Y.compressedTexImage2D(a,b,c,f,h,l,n,q):Y.compressedTexImage2D(a,b,c,f,h,l,G,q,n):Y.compressedTexImage2D(a,b,c,f,h,l,q?G.subarray(q,q+n):null)},ga:function(a,b,c,f,h,l,n,q,w){2<=v.version?Y.Ce?Y.compressedTexSubImage2D(a,b,c,f,h,l,n,q,w):Y.compressedTexSubImage2D(a,b,c,f,h,l,n,G,w,q):Y.compressedTexSubImage2D(a,b,c,f,h,l,n,w?G.subarray(w,w+q):null)},ha:function(a,b,c,f,h,l,n,q){Y.copyTexSubImage2D(a, 230 | b,c,f,h,l,n,q)},ia:function(){var a=ka(ud),b=Y.createProgram();b.name=a;b.Xe=b.Ve=b.We=0;b.kf=1;ud[a]=b;return a},ja:function(a){var b=ka(xd);xd[b]=Y.createShader(a);return b},ka:function(a){Y.cullFace(a)},la:function(a,b){for(var c=0;c>2],h=td[f];h&&(Y.deleteBuffer(h),h.name=0,td[f]=null,f==Y.ff&&(Y.ff=0),f==Y.Ce&&(Y.Ce=0))}},ec:function(a,b){for(var c=0;c>2],h=vd[f];h&&(Y.deleteFramebuffer(h),h.name=0,vd[f]=null)}},ma:function(a){if(a){var b=ud[a];b?(Y.deleteProgram(b), 231 | b.name=0,ud[a]=null):Ed(1281)}},fc:function(a,b){for(var c=0;c>2],h=wd[f];h&&(Y.deleteRenderbuffer(h),h.name=0,wd[f]=null)}},Rb:function(a,b){for(var c=0;c>2],h=zd[f];h&&(Y.deleteSampler(h),h.name=0,zd[f]=null)}},na:function(a){if(a){var b=xd[a];b?(Y.deleteShader(b),xd[a]=null):Ed(1281)}},Zb:function(a){if(a){var b=Ad[a];b?(Y.deleteSync(b),b.name=0,Ad[a]=null):Ed(1281)}},oa:function(a,b){for(var c=0;c>2],h=la[f];h&&(Y.deleteTexture(h), 232 | h.name=0,la[f]=null)}},xc:function(a,b){for(var c=0;c>2];Y.deleteVertexArray(yd[f]);yd[f]=null}},Ac:function(a,b){for(var c=0;c>2];Y.deleteVertexArray(yd[f]);yd[f]=null}},pa:function(a){Y.depthMask(!!a)},qa:function(a){Y.disable(a)},ra:function(a){Y.disableVertexAttribArray(a)},sa:function(a,b,c){Y.drawArrays(a,b,c)},uc:function(a,b,c,f){Y.drawArraysInstanced(a,b,c,f)},sc:function(a,b,c,f,h){Y.pf.drawArraysInstancedBaseInstanceWEBGL(a,b,c,f,h)},qc:function(a, 233 | b){for(var c=Kd[a],f=0;f>2];Y.drawBuffers(c)},ta:function(a,b,c,f){Y.drawElements(a,b,c,f)},vc:function(a,b,c,f,h){Y.drawElementsInstanced(a,b,c,f,h)},tc:function(a,b,c,f,h,l,n){Y.pf.drawElementsInstancedBaseVertexBaseInstanceWEBGL(a,b,c,f,h,l,n)},kc:function(a,b,c,f,h,l){Y.drawElements(a,f,h,l)},ua:function(a){Y.enable(a)},va:function(a){Y.enableVertexAttribArray(a)},Vb:function(a,b){return(a=Y.fenceSync(a,b))?(b=ka(Ad),a.name=b,Ad[b]=a,b):0},wa:function(){Y.finish()},xa:function(){Y.flush()}, 234 | gc:function(a,b,c,f){Y.framebufferRenderbuffer(a,b,c,wd[f])},hc:function(a,b,c,f,h){Y.framebufferTexture2D(a,b,c,la[f],h)},ya:function(a){Y.frontFace(a)},za:function(a,b){Ld(a,b,"createBuffer",td)},ic:function(a,b){Ld(a,b,"createFramebuffer",vd)},jc:function(a,b){Ld(a,b,"createRenderbuffer",wd)},Sb:function(a,b){Ld(a,b,"createSampler",zd)},Aa:function(a,b){Ld(a,b,"createTexture",la)},yc:function(a,b){Ld(a,b,"createVertexArray",yd)},Bc:function(a,b){Ld(a,b,"createVertexArray",yd)},_b:function(a){Y.generateMipmap(a)}, 235 | Ba:function(a,b,c){c?O[c>>2]=Y.getBufferParameter(a,b):Ed(1281)},Ca:function(){var a=Y.getError()||Hd;Hd=0;return a},$b:function(a,b,c,f){a=Y.getFramebufferAttachmentParameter(a,b,c);if(a instanceof WebGLRenderbuffer||a instanceof WebGLTexture)a=a.name|0;O[f>>2]=a},E:function(a,b){Md(a,b)},Da:function(a,b,c,f){a=Y.getProgramInfoLog(ud[a]);null===a&&(a="(unknown error)");b=0>2]=b)},Ea:function(a,b,c){if(c)if(a>=sd)Ed(1281);else if(a=ud[a],35716==b)a=Y.getProgramInfoLog(a), 236 | null===a&&(a="(unknown error)"),O[c>>2]=a.length+1;else if(35719==b){if(!a.Xe)for(b=0;b>2]=a.Xe}else if(35722==b){if(!a.Ve)for(b=0;b>2]=a.Ve}else if(35381==b){if(!a.We)for(b=0;b>2]=a.We}else O[c>>2]=Y.getProgramParameter(a, 237 | b);else Ed(1281)},ac:function(a,b,c){c?O[c>>2]=Y.getRenderbufferParameter(a,b):Ed(1281)},Fa:function(a,b,c,f){a=Y.getShaderInfoLog(xd[a]);null===a&&(a="(unknown error)");b=0>2]=b)},Nb:function(a,b,c,f){a=Y.getShaderPrecisionFormat(a,b);O[c>>2]=a.rangeMin;O[c+4>>2]=a.rangeMax;O[f>>2]=a.precision},Ga:function(a,b,c){c?35716==b?(a=Y.getShaderInfoLog(xd[a]),null===a&&(a="(unknown error)"),O[c>>2]=a?a.length+1:0):35720==b?(a=Y.getShaderSource(xd[a]),O[c>>2]=a?a.length+1:0): 238 | O[c>>2]=Y.getShaderParameter(xd[a],b):Ed(1281)},J:function(a){var b=Bd[a];if(!b){switch(a){case 7939:b=Y.getSupportedExtensions()||[];b=b.concat(b.map(function(f){return"GL_"+f}));b=Nd(b.join(" "));break;case 7936:case 7937:case 37445:case 37446:(b=Y.getParameter(a))||Ed(1280);b=b&&Nd(b);break;case 7938:b=Y.getParameter(7938);b=2<=v.version?"OpenGL ES 3.0 ("+b+")":"OpenGL ES 2.0 ("+b+")";b=Nd(b);break;case 35724:b=Y.getParameter(35724);var c=b.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/); 239 | null!==c&&(3==c[1].length&&(c[1]+="0"),b="OpenGL ES GLSL ES "+c[1]+" ("+b+")");b=Nd(b);break;default:Ed(1280)}Bd[a]=b}return b},cb:function(a,b){if(2>v.version)return Ed(1282),0;var c=Cd[a];if(c)return 0>b||b>=c.length?(Ed(1281),0):c[b];switch(a){case 7939:return c=Y.getSupportedExtensions()||[],c=c.concat(c.map(function(f){return"GL_"+f})),c=c.map(function(f){return Nd(f)}),c=Cd[a]=c,0>b||b>=c.length?(Ed(1281),0):c[b];default:return Ed(1280),0}},Ha:function(a,b){b=Xa(b);if(a=ud[a]){var c=a,f=c.Oe, 240 | h=c.xf,l;if(!f)for(c.Oe=f={},c.wf={},l=0;l>>0,h=b.slice(0,l));if((h=a.xf[h])&&f>2];Y.invalidateFramebuffer(a,f)}, 241 | Pb:function(a,b,c,f,h,l,n){for(var q=Kd[b],w=0;w>2];Y.invalidateSubFramebuffer(a,q,f,h,l,n)},Wb:function(a){return Y.isSync(Ad[a])},Ia:function(a){return(a=la[a])?Y.isTexture(a):0},Ja:function(a){Y.lineWidth(a)},La:function(a){a=ud[a];Y.linkProgram(a);a.Oe=0;a.xf={}},oc:function(a,b,c,f,h,l){Y.uf.multiDrawArraysInstancedBaseInstanceWEBGL(a,O,b>>2,O,c>>2,O,f>>2,ob,h>>2,l)},pc:function(a,b,c,f,h,l,n,q){Y.uf.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(a,O,b>>2,c,O,f>>2, 242 | O,h>>2,O,l>>2,ob,n>>2,q)},Ma:function(a,b){3317==a&&(Dd=b);Y.pixelStorei(a,b)},rc:function(a){Y.readBuffer(a)},Na:function(a,b,c,f,h,l,n){if(2<=v.version)if(Y.ff)Y.readPixels(a,b,c,f,h,l,n);else{var q=Qd(l);Y.readPixels(a,b,c,f,h,l,q,n>>31-Math.clz32(q.BYTES_PER_ELEMENT))}else(n=Rd(l,h,c,f,n))?Y.readPixels(a,b,c,f,h,l,n):Ed(1280)},bc:function(a,b,c,f){Y.renderbufferStorage(a,b,c,f)},Yb:function(a,b,c,f,h){Y.renderbufferStorageMultisample(a,b,c,f,h)},Tb:function(a,b,c){Y.samplerParameteri(zd[a],b, 243 | c)},Ub:function(a,b,c){Y.samplerParameteri(zd[a],b,O[c>>2])},Oa:function(a,b,c,f){Y.scissor(a,b,c,f)},Pa:function(a,b,c,f){for(var h="",l=0;l>2]:-1;h+=Xa(O[c+4*l>>2],0>n?void 0:n)}Y.shaderSource(xd[a],h)},Qa:function(a,b,c){Y.stencilFunc(a,b,c)},Ra:function(a,b,c,f){Y.stencilFuncSeparate(a,b,c,f)},Sa:function(a){Y.stencilMask(a)},Ta:function(a,b){Y.stencilMaskSeparate(a,b)},Ua:function(a,b,c){Y.stencilOp(a,b,c)},Va:function(a,b,c,f){Y.stencilOpSeparate(a,b,c,f)},Wa:function(a, 244 | b,c,f,h,l,n,q,w){if(2<=v.version)if(Y.Ce)Y.texImage2D(a,b,c,f,h,l,n,q,w);else if(w){var x=Qd(q);Y.texImage2D(a,b,c,f,h,l,n,q,x,w>>31-Math.clz32(x.BYTES_PER_ELEMENT))}else Y.texImage2D(a,b,c,f,h,l,n,q,null);else Y.texImage2D(a,b,c,f,h,l,n,q,w?Rd(q,n,f,h,w):null)},Xa:function(a,b,c){Y.texParameterf(a,b,c)},Ya:function(a,b,c){Y.texParameterf(a,b,U[c>>2])},Za:function(a,b,c){Y.texParameteri(a,b,c)},_a:function(a,b,c){Y.texParameteri(a,b,O[c>>2])},lc:function(a,b,c,f,h){Y.texStorage2D(a,b,c,f,h)},$a:function(a, 245 | b,c,f,h,l,n,q,w){if(2<=v.version)if(Y.Ce)Y.texSubImage2D(a,b,c,f,h,l,n,q,w);else if(w){var x=Qd(q);Y.texSubImage2D(a,b,c,f,h,l,n,q,x,w>>31-Math.clz32(x.BYTES_PER_ELEMENT))}else Y.texSubImage2D(a,b,c,f,h,l,n,q,null);else x=null,w&&(x=Rd(q,n,h,l,w)),Y.texSubImage2D(a,b,c,f,h,l,n,q,x)},ab:function(a,b){Y.uniform1f(Z(a),b)},bb:function(a,b,c){if(2<=v.version)Y.uniform1fv(Z(a),U,c>>2,b);else{if(288>=b)for(var f=Sd[b-1],h=0;h>2];else f=U.subarray(c>>2,c+4*b>>2);Y.uniform1fv(Z(a),f)}}, 246 | Wc:function(a,b){Y.uniform1i(Z(a),b)},Xc:function(a,b,c){if(2<=v.version)Y.uniform1iv(Z(a),O,c>>2,b);else{if(288>=b)for(var f=Td[b-1],h=0;h>2];else f=O.subarray(c>>2,c+4*b>>2);Y.uniform1iv(Z(a),f)}},Yc:function(a,b,c){Y.uniform2f(Z(a),b,c)},Zc:function(a,b,c){if(2<=v.version)Y.uniform2fv(Z(a),U,c>>2,2*b);else{if(144>=b)for(var f=Sd[2*b-1],h=0;h<2*b;h+=2)f[h]=U[c+4*h>>2],f[h+1]=U[c+(4*h+4)>>2];else f=U.subarray(c>>2,c+8*b>>2);Y.uniform2fv(Z(a),f)}},Vc:function(a,b,c){Y.uniform2i(Z(a), 247 | b,c)},Uc:function(a,b,c){if(2<=v.version)Y.uniform2iv(Z(a),O,c>>2,2*b);else{if(144>=b)for(var f=Td[2*b-1],h=0;h<2*b;h+=2)f[h]=O[c+4*h>>2],f[h+1]=O[c+(4*h+4)>>2];else f=O.subarray(c>>2,c+8*b>>2);Y.uniform2iv(Z(a),f)}},Tc:function(a,b,c,f){Y.uniform3f(Z(a),b,c,f)},Sc:function(a,b,c){if(2<=v.version)Y.uniform3fv(Z(a),U,c>>2,3*b);else{if(96>=b)for(var f=Sd[3*b-1],h=0;h<3*b;h+=3)f[h]=U[c+4*h>>2],f[h+1]=U[c+(4*h+4)>>2],f[h+2]=U[c+(4*h+8)>>2];else f=U.subarray(c>>2,c+12*b>>2);Y.uniform3fv(Z(a),f)}},Rc:function(a, 248 | b,c,f){Y.uniform3i(Z(a),b,c,f)},Qc:function(a,b,c){if(2<=v.version)Y.uniform3iv(Z(a),O,c>>2,3*b);else{if(96>=b)for(var f=Td[3*b-1],h=0;h<3*b;h+=3)f[h]=O[c+4*h>>2],f[h+1]=O[c+(4*h+4)>>2],f[h+2]=O[c+(4*h+8)>>2];else f=O.subarray(c>>2,c+12*b>>2);Y.uniform3iv(Z(a),f)}},Pc:function(a,b,c,f,h){Y.uniform4f(Z(a),b,c,f,h)},Oc:function(a,b,c){if(2<=v.version)Y.uniform4fv(Z(a),U,c>>2,4*b);else{if(72>=b){var f=Sd[4*b-1],h=U;c>>=2;for(var l=0;l<4*b;l+=4){var n=c+l;f[l]=h[n];f[l+1]=h[n+1];f[l+2]=h[n+2];f[l+3]= 249 | h[n+3]}}else f=U.subarray(c>>2,c+16*b>>2);Y.uniform4fv(Z(a),f)}},Cc:function(a,b,c,f,h){Y.uniform4i(Z(a),b,c,f,h)},Dc:function(a,b,c){if(2<=v.version)Y.uniform4iv(Z(a),O,c>>2,4*b);else{if(72>=b)for(var f=Td[4*b-1],h=0;h<4*b;h+=4)f[h]=O[c+4*h>>2],f[h+1]=O[c+(4*h+4)>>2],f[h+2]=O[c+(4*h+8)>>2],f[h+3]=O[c+(4*h+12)>>2];else f=O.subarray(c>>2,c+16*b>>2);Y.uniform4iv(Z(a),f)}},Ec:function(a,b,c,f){if(2<=v.version)Y.uniformMatrix2fv(Z(a),!!c,U,f>>2,4*b);else{if(72>=b)for(var h=Sd[4*b-1],l=0;l<4*b;l+=4)h[l]= 250 | U[f+4*l>>2],h[l+1]=U[f+(4*l+4)>>2],h[l+2]=U[f+(4*l+8)>>2],h[l+3]=U[f+(4*l+12)>>2];else h=U.subarray(f>>2,f+16*b>>2);Y.uniformMatrix2fv(Z(a),!!c,h)}},Fc:function(a,b,c,f){if(2<=v.version)Y.uniformMatrix3fv(Z(a),!!c,U,f>>2,9*b);else{if(32>=b)for(var h=Sd[9*b-1],l=0;l<9*b;l+=9)h[l]=U[f+4*l>>2],h[l+1]=U[f+(4*l+4)>>2],h[l+2]=U[f+(4*l+8)>>2],h[l+3]=U[f+(4*l+12)>>2],h[l+4]=U[f+(4*l+16)>>2],h[l+5]=U[f+(4*l+20)>>2],h[l+6]=U[f+(4*l+24)>>2],h[l+7]=U[f+(4*l+28)>>2],h[l+8]=U[f+(4*l+32)>>2];else h=U.subarray(f>> 251 | 2,f+36*b>>2);Y.uniformMatrix3fv(Z(a),!!c,h)}},Gc:function(a,b,c,f){if(2<=v.version)Y.uniformMatrix4fv(Z(a),!!c,U,f>>2,16*b);else{if(18>=b){var h=Sd[16*b-1],l=U;f>>=2;for(var n=0;n<16*b;n+=16){var q=f+n;h[n]=l[q];h[n+1]=l[q+1];h[n+2]=l[q+2];h[n+3]=l[q+3];h[n+4]=l[q+4];h[n+5]=l[q+5];h[n+6]=l[q+6];h[n+7]=l[q+7];h[n+8]=l[q+8];h[n+9]=l[q+9];h[n+10]=l[q+10];h[n+11]=l[q+11];h[n+12]=l[q+12];h[n+13]=l[q+13];h[n+14]=l[q+14];h[n+15]=l[q+15]}}else h=U.subarray(f>>2,f+64*b>>2);Y.uniformMatrix4fv(Z(a),!!c,h)}}, 252 | Hc:function(a){a=ud[a];Y.useProgram(a);Y.Gf=a},Ic:function(a,b){Y.vertexAttrib1f(a,b)},Jc:function(a,b){Y.vertexAttrib2f(a,U[b>>2],U[b+4>>2])},Kc:function(a,b){Y.vertexAttrib3f(a,U[b>>2],U[b+4>>2],U[b+8>>2])},Lc:function(a,b){Y.vertexAttrib4f(a,U[b>>2],U[b+4>>2],U[b+8>>2],U[b+12>>2])},mc:function(a,b){Y.vertexAttribDivisor(a,b)},nc:function(a,b,c,f,h){Y.vertexAttribIPointer(a,b,c,f,h)},Mc:function(a,b,c,f,h,l){Y.vertexAttribPointer(a,b,c,!!f,h,l)},Nc:function(a,b,c,f){Y.viewport(a,b,c,f)},eb:function(a, 253 | b,c,f){Y.waitSync(Ad[a],b,(c>>>0)+4294967296*f)},qb:function(a){var b=G.length;a>>>=0;if(2147483648=c;c*=2){var f=b*(1+.2/c);f=Math.min(f,a+100663296);f=Math.max(a,f);0>>16);qb();var h=1;break a}catch(l){}h=void 0}if(h)return!0}return!1},ib:function(){return v?v.Vf:0},ub:function(a,b){var c=0;Vd().forEach(function(f,h){var l=b+c;h=O[a+4*h>>2]=l;for(l=0;l>0]=f.charCodeAt(l); 254 | nb[h>>0]=0;c+=f.length+1});return 0},vb:function(a,b){var c=Vd();O[a>>2]=c.length;var f=0;c.forEach(function(h){f+=h.length+1});O[b>>2]=f;return 0},Hb:function(a){if(!(noExitRuntime||0>2]=b;return 0},Ab:function(a,b,c,f){a=Lb.Rf(a);b=Lb.If(a,b,c);O[f>>2]=b;return 0},lb:function(){},N:function(a,b,c,f){for(var h=0,l=0;l>2],q=O[b+4>>2];b+=8;for(var w= 255 | 0;w>2]=h;return 0},b:function(){return Pa},i:ke,n:le,f:me,C:ne,Mb:oe,U:pe,T:qe,I:re,m:se,s:te,h:ue,q:ve,Kb:we,Ib:xe,Jb:ye,c:function(a){Pa=a},nb:function(a,b,c,f){return be(a,b,c,f)}}; 256 | (function(){function a(h){t.asm=h.exports;Sa=t.asm.bd;qb();rb=t.asm.dd;tb.unshift(t.asm.cd);wb--;t.monitorRunDependencies&&t.monitorRunDependencies(wb);0==wb&&(null!==xb&&(clearInterval(xb),xb=null),zb&&(h=zb,zb=null,h()))}function b(h){a(h.instance)}function c(h){return Eb().then(function(l){return WebAssembly.instantiate(l,f)}).then(function(l){return l}).then(h,function(l){Ma("failed to asynchronously prepare wasm: "+l);Ra(l)})}var f={a:ze};wb++;t.monitorRunDependencies&&t.monitorRunDependencies(wb); 257 | if(t.instantiateWasm)try{return t.instantiateWasm(f,a)}catch(h){return Ma("Module.instantiateWasm callback failed with error: "+h),!1}(function(){return Qa||"function"!==typeof WebAssembly.instantiateStreaming||Ab()||Bb.startsWith("file://")||"function"!==typeof fetch?c(b):fetch(Bb,{credentials:"same-origin"}).then(function(h){return WebAssembly.instantiateStreaming(h,f).then(b,function(l){Ma("wasm streaming compile failed: "+l);Ma("falling back to ArrayBuffer instantiation");return c(b)})})})().catch(ha); 258 | return{}})();t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.cd).apply(null,arguments)};var Od=t._malloc=function(){return(Od=t._malloc=t.asm.ed).apply(null,arguments)},Tc=t._free=function(){return(Tc=t._free=t.asm.fd).apply(null,arguments)},je=t.___errno_location=function(){return(je=t.___errno_location=t.asm.gd).apply(null,arguments)},Sc=t.___getTypeName=function(){return(Sc=t.___getTypeName=t.asm.hd).apply(null,arguments)}; 259 | t.___embind_register_native_and_builtin_types=function(){return(t.___embind_register_native_and_builtin_types=t.asm.id).apply(null,arguments)};var ie=t._memalign=function(){return(ie=t._memalign=t.asm.jd).apply(null,arguments)},Ae=t._setThrew=function(){return(Ae=t._setThrew=t.asm.kd).apply(null,arguments)},Be=t.stackSave=function(){return(Be=t.stackSave=t.asm.ld).apply(null,arguments)},Ce=t.stackRestore=function(){return(Ce=t.stackRestore=t.asm.md).apply(null,arguments)}; 260 | t.dynCall_iiiji=function(){return(t.dynCall_iiiji=t.asm.nd).apply(null,arguments)};t.dynCall_ji=function(){return(t.dynCall_ji=t.asm.od).apply(null,arguments)};t.dynCall_iiji=function(){return(t.dynCall_iiji=t.asm.pd).apply(null,arguments)};t.dynCall_iijjiii=function(){return(t.dynCall_iijjiii=t.asm.qd).apply(null,arguments)};t.dynCall_iij=function(){return(t.dynCall_iij=t.asm.rd).apply(null,arguments)};t.dynCall_vijjjii=function(){return(t.dynCall_vijjjii=t.asm.sd).apply(null,arguments)}; 261 | t.dynCall_viji=function(){return(t.dynCall_viji=t.asm.td).apply(null,arguments)};t.dynCall_vijiii=function(){return(t.dynCall_vijiii=t.asm.ud).apply(null,arguments)};t.dynCall_viiiiij=function(){return(t.dynCall_viiiiij=t.asm.vd).apply(null,arguments)};t.dynCall_jii=function(){return(t.dynCall_jii=t.asm.wd).apply(null,arguments)};t.dynCall_iiij=function(){return(t.dynCall_iiij=t.asm.xd).apply(null,arguments)};t.dynCall_iiiij=function(){return(t.dynCall_iiiij=t.asm.yd).apply(null,arguments)}; 262 | t.dynCall_viij=function(){return(t.dynCall_viij=t.asm.zd).apply(null,arguments)};t.dynCall_viiij=function(){return(t.dynCall_viiij=t.asm.Ad).apply(null,arguments)};t.dynCall_vij=function(){return(t.dynCall_vij=t.asm.Bd).apply(null,arguments)};t.dynCall_jiiii=function(){return(t.dynCall_jiiii=t.asm.Cd).apply(null,arguments)};t.dynCall_jiiiiii=function(){return(t.dynCall_jiiiiii=t.asm.Dd).apply(null,arguments)};t.dynCall_jiiiiji=function(){return(t.dynCall_jiiiiji=t.asm.Ed).apply(null,arguments)}; 263 | t.dynCall_iijj=function(){return(t.dynCall_iijj=t.asm.Fd).apply(null,arguments)};t.dynCall_jiji=function(){return(t.dynCall_jiji=t.asm.Gd).apply(null,arguments)};t.dynCall_viijii=function(){return(t.dynCall_viijii=t.asm.Hd).apply(null,arguments)};t.dynCall_iiiiij=function(){return(t.dynCall_iiiiij=t.asm.Id).apply(null,arguments)};t.dynCall_iiiiijj=function(){return(t.dynCall_iiiiijj=t.asm.Jd).apply(null,arguments)};t.dynCall_iiiiiijj=function(){return(t.dynCall_iiiiiijj=t.asm.Kd).apply(null,arguments)}; 264 | function ke(a,b){var c=Be();try{return Gb(a)(b)}catch(f){Ce(c);if(f!==f+0&&"longjmp"!==f)throw f;Ae(1,0)}}function le(a,b,c){var f=Be();try{return Gb(a)(b,c)}catch(h){Ce(f);if(h!==h+0&&"longjmp"!==h)throw h;Ae(1,0)}}function ue(a,b,c,f){var h=Be();try{Gb(a)(b,c,f)}catch(l){Ce(h);if(l!==l+0&&"longjmp"!==l)throw l;Ae(1,0)}}function me(a,b,c,f){var h=Be();try{return Gb(a)(b,c,f)}catch(l){Ce(h);if(l!==l+0&&"longjmp"!==l)throw l;Ae(1,0)}} 265 | function se(a,b){var c=Be();try{Gb(a)(b)}catch(f){Ce(c);if(f!==f+0&&"longjmp"!==f)throw f;Ae(1,0)}}function te(a,b,c){var f=Be();try{Gb(a)(b,c)}catch(h){Ce(f);if(h!==h+0&&"longjmp"!==h)throw h;Ae(1,0)}}function oe(a,b,c,f,h,l){var n=Be();try{return Gb(a)(b,c,f,h,l)}catch(q){Ce(n);if(q!==q+0&&"longjmp"!==q)throw q;Ae(1,0)}}function ve(a,b,c,f,h){var l=Be();try{Gb(a)(b,c,f,h)}catch(n){Ce(l);if(n!==n+0&&"longjmp"!==n)throw n;Ae(1,0)}} 266 | function pe(a,b,c,f,h,l,n){var q=Be();try{return Gb(a)(b,c,f,h,l,n)}catch(w){Ce(q);if(w!==w+0&&"longjmp"!==w)throw w;Ae(1,0)}}function ne(a,b,c,f,h){var l=Be();try{return Gb(a)(b,c,f,h)}catch(n){Ce(l);if(n!==n+0&&"longjmp"!==n)throw n;Ae(1,0)}}function we(a,b,c,f,h,l){var n=Be();try{Gb(a)(b,c,f,h,l)}catch(q){Ce(n);if(q!==q+0&&"longjmp"!==q)throw q;Ae(1,0)}}function ye(a,b,c,f,h,l,n,q,w,x){var J=Be();try{Gb(a)(b,c,f,h,l,n,q,w,x)}catch(K){Ce(J);if(K!==K+0&&"longjmp"!==K)throw K;Ae(1,0)}} 267 | function re(a){var b=Be();try{Gb(a)()}catch(c){Ce(b);if(c!==c+0&&"longjmp"!==c)throw c;Ae(1,0)}}function xe(a,b,c,f,h,l,n){var q=Be();try{Gb(a)(b,c,f,h,l,n)}catch(w){Ce(q);if(w!==w+0&&"longjmp"!==w)throw w;Ae(1,0)}}function qe(a,b,c,f,h,l,n,q,w,x){var J=Be();try{return Gb(a)(b,c,f,h,l,n,q,w,x)}catch(K){Ce(J);if(K!==K+0&&"longjmp"!==K)throw K;Ae(1,0)}}var De;function Ka(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}zb=function Ee(){De||Fe();De||(zb=Ee)}; 268 | function Fe(){function a(){if(!De&&(De=!0,t.calledRun=!0,!Ua)){Fb(tb);fa(t);if(t.onRuntimeInitialized)t.onRuntimeInitialized();if(t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;){var b=t.postRun.shift();ub.unshift(b)}Fb(ub)}}if(!(0 Flutter jumps. 34 | this.didCreateEngineInitializer = this._didCreateEngineInitializer.bind(this); 35 | } 36 | 37 | /** 38 | * Initializes the main.dart.js with/without serviceWorker. 39 | * @param {*} options 40 | * @returns a Promise that will eventually resolve with an EngineInitializer, 41 | * or will be rejected with the error caused by the loader. 42 | */ 43 | loadEntrypoint(options) { 44 | const { 45 | entrypointUrl = "main.dart.js", 46 | serviceWorker, 47 | } = (options || {}); 48 | return this._loadWithServiceWorker(entrypointUrl, serviceWorker); 49 | } 50 | 51 | /** 52 | * Resolves the promise created by loadEntrypoint. 53 | * Called by Flutter through the public `didCreateEngineInitializer` method, 54 | * which is bound to the correct instance of the FlutterLoader on the page. 55 | * @param {*} engineInitializer 56 | */ 57 | _didCreateEngineInitializer(engineInitializer) { 58 | if (typeof this._didCreateEngineInitializerResolve != "function") { 59 | console.warn("Do not call didCreateEngineInitializer by hand. Start with loadEntrypoint instead."); 60 | } 61 | this._didCreateEngineInitializerResolve(engineInitializer); 62 | // Remove the public method after it's done, so Flutter Web can hot restart. 63 | delete this.didCreateEngineInitializer; 64 | } 65 | 66 | _loadEntrypoint(entrypointUrl) { 67 | if (!this._scriptLoaded) { 68 | this._scriptLoaded = new Promise((resolve, reject) => { 69 | let scriptTag = document.createElement("script"); 70 | scriptTag.src = entrypointUrl; 71 | scriptTag.type = "application/javascript"; 72 | // Cache the resolve, so it can be called from Flutter. 73 | // Note: Flutter hot restart doesn't re-create this promise, so this 74 | // can only be called once. Instead, we need to model this as a stream 75 | // of `engineCreated` events coming from Flutter that are handled by JS. 76 | this._didCreateEngineInitializerResolve = resolve; 77 | scriptTag.addEventListener("error", reject); 78 | document.body.append(scriptTag); 79 | }); 80 | } 81 | 82 | return this._scriptLoaded; 83 | } 84 | 85 | _waitForServiceWorkerActivation(serviceWorker, entrypointUrl) { 86 | if (!serviceWorker || serviceWorker.state == "activated") { 87 | if (!serviceWorker) { 88 | console.warn("Cannot activate a null service worker. Falling back to plain 50 | 51 | 52 | 53 | 54 |
55 | 83 | Loading indicator... 84 |
85 | 86 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /docs/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "brain_punk", 3 | "short_name": "brain_punk", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /docs/version.json: -------------------------------------------------------------------------------- 1 | {"app_name":"brain_punk","version":"1.0.0","build_number":"1","package_name":"brain_punk"} -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flame/text.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/services.dart'; 4 | import 'package:flame/input.dart'; 5 | import 'package:flame/flame.dart'; 6 | import 'package:flame/components.dart'; 7 | import 'package:flame/game.dart'; 8 | import 'package:flame/palette.dart'; 9 | 10 | void main() async { 11 | // Create an instance of the game 12 | final brainPunk = BrainPunk(); 13 | 14 | WidgetsFlutterBinding.ensureInitialized(); 15 | await Flame.device.fullScreen(); 16 | await Flame.device.setLandscape(); 17 | runApp(GameWidget(game: brainPunk)); 18 | } 19 | 20 | class BrainPunk extends FlameGame with HasTappables, KeyboardEvents { 21 | late Map jsonData; 22 | late dynamic dataArray; 23 | final double tc = 0.05; 24 | late SpriteComponent background; 25 | NextButton nextButton = NextButton(); 26 | late MyTextBox prompt; 27 | late MyTextBox instruction; 28 | final Vector2 buttonSize = Vector2(125.0, 45.0); 29 | int currentScene = 0; 30 | String input = ""; 31 | bool hasInput = false; 32 | 33 | TextPaint answerTextPaint = TextPaint(style: _bigTextStyle); 34 | 35 | @override 36 | Future onLoad() async { 37 | final screenWidth = size[0]; 38 | final screenHeight = size[1]; 39 | 40 | Sprite bg = await loadSprite('story/$currentScene.png'); 41 | background = SpriteComponent() 42 | ..sprite = bg 43 | ..size = Vector2(bg.srcSize.x, screenHeight); 44 | 45 | add(background); 46 | 47 | jsonData = await assets.readJson('data/story.json'); 48 | dataArray = jsonData["data"]; 49 | String text = dataArray[currentScene]["q"]; 50 | prompt = MyTextBox( 51 | text, 52 | timePerChar: tc, 53 | ) 54 | ..anchor = Anchor.topRight 55 | ..x = size.x - 32.0; 56 | add(prompt); 57 | 58 | instruction = MyTextBox( 59 | "Use Keyboard to Type", 60 | timePerChar: 0.0, 61 | renderer: _lil, 62 | ); 63 | 64 | nextButton 65 | ..sprite = await loadSprite('buttons/next.png') 66 | ..size = buttonSize 67 | ..position = Vector2( 68 | screenWidth - buttonSize[0] - 20, screenHeight - buttonSize[1] - 20); 69 | Future.delayed(Duration(seconds: (tc * text.length).round()), () { 70 | add(nextButton); 71 | }); 72 | } 73 | 74 | @override 75 | Future render(Canvas canvas) async { 76 | super.render(canvas); 77 | if (nextButton.storyLevel != currentScene) { 78 | currentScene = nextButton.storyLevel; 79 | hasInput = (dataArray[currentScene]["a"] != null) ? true : false; 80 | //print("$currentScene : $hasInput"); 81 | input = ""; 82 | Sprite bg = await loadSprite('story/$currentScene.png'); 83 | 84 | if (contains(nextButton)) remove(nextButton); 85 | if (contains(prompt)) remove(prompt); 86 | if (contains(instruction)) remove(instruction); 87 | 88 | background = SpriteComponent() 89 | ..sprite = bg 90 | ..size = Vector2(bg.srcSize.x, size[1]); 91 | if (contains(background)) remove(background); 92 | add(background); 93 | 94 | String text = dataArray[currentScene]["q"]; 95 | prompt = MyTextBox( 96 | text, 97 | timePerChar: tc, 98 | ) 99 | ..anchor = Anchor.topRight 100 | ..x = size.x - 32.0; 101 | add(prompt); 102 | 103 | if (!hasInput && dataArray[currentScene]["id"] != null) { 104 | Future.delayed(Duration(seconds: (tc * text.length).round()), () { 105 | add(nextButton); 106 | }); 107 | } else if (hasInput) { 108 | instruction = MyTextBox( 109 | "Use Keyboard to Type", 110 | timePerChar: 0.0, 111 | renderer: _lil, 112 | ) 113 | ..x = prompt.x - prompt.width 114 | ..y = 10 + prompt.height; 115 | Future.delayed(Duration(seconds: (tc * text.length).round()), () { 116 | add(instruction); 117 | }); 118 | } 119 | } 120 | 121 | if (hasInput) { 122 | if (input != "") { 123 | answerTextPaint.render(canvas, input, 124 | Vector2(prompt.x - prompt.width + 25, 100 + prompt.height)); 125 | } 126 | if (dataArray[currentScene]["a"] == input) { 127 | if (!contains(nextButton)) add(nextButton); 128 | } else { 129 | if (contains(nextButton)) remove(nextButton); 130 | } 131 | } 132 | } 133 | 134 | @override 135 | KeyEventResult onKeyEvent( 136 | RawKeyEvent event, 137 | Set keysPressed, 138 | ) { 139 | final isKeyDown = event is RawKeyDownEvent; 140 | 141 | if (event.logicalKey == LogicalKeyboardKey.digit0) { 142 | input += isKeyDown ? "0" : ""; 143 | } else if (event.logicalKey == LogicalKeyboardKey.digit1) { 144 | input += isKeyDown ? "1" : ""; 145 | } else if (event.logicalKey == LogicalKeyboardKey.digit2) { 146 | input += isKeyDown ? "2" : ""; 147 | } else if (event.logicalKey == LogicalKeyboardKey.digit3) { 148 | input += isKeyDown ? "3" : ""; 149 | } else if (event.logicalKey == LogicalKeyboardKey.digit4) { 150 | input += isKeyDown ? "4" : ""; 151 | } else if (event.logicalKey == LogicalKeyboardKey.digit5) { 152 | input += isKeyDown ? "5" : ""; 153 | } else if (event.logicalKey == LogicalKeyboardKey.digit6) { 154 | input += isKeyDown ? "6" : ""; 155 | } else if (event.logicalKey == LogicalKeyboardKey.digit7) { 156 | input += isKeyDown ? "7" : ""; 157 | } else if (event.logicalKey == LogicalKeyboardKey.digit8) { 158 | input += isKeyDown ? "8" : ""; 159 | } else if (event.logicalKey == LogicalKeyboardKey.digit9) { 160 | input += isKeyDown ? "9" : ""; 161 | } else if (event.logicalKey == LogicalKeyboardKey.delete || 162 | event.logicalKey == LogicalKeyboardKey.backspace) { 163 | input = (isKeyDown && input != "") 164 | ? input.substring(0, input.length - 1) 165 | : input; 166 | } 167 | return super.onKeyEvent(event, keysPressed); 168 | } 169 | } 170 | 171 | class NextButton extends SpriteComponent with Tappable { 172 | int storyLevel = 0; 173 | @override 174 | bool onTapDown(dynamic info) { 175 | try { 176 | storyLevel++; 177 | return true; 178 | } catch (error) { 179 | return false; 180 | } 181 | } 182 | } 183 | 184 | final _regularTextStyle = TextStyle( 185 | fontFamily: 'monospace', 186 | fontSize: 18, 187 | letterSpacing: 2.0, 188 | color: BasicPalette.white.color, 189 | ); 190 | final _bigTextStyle = _regularTextStyle.copyWith(fontSize: 36); 191 | final _lilTextStyle = _regularTextStyle.copyWith(fontSize: 14); 192 | final _regular = TextPaint(style: _regularTextStyle); 193 | final _lil = TextPaint(style: _lilTextStyle); 194 | 195 | class MyTextBox extends TextBoxComponent { 196 | MyTextBox(String text, 197 | {super.align, 198 | super.size, 199 | double? timePerChar, 200 | double? margins, 201 | TextRenderer? renderer}) 202 | : super( 203 | text: text, 204 | textRenderer: renderer ?? _regular, 205 | boxConfig: TextBoxConfig( 206 | maxWidth: 300, 207 | timePerChar: timePerChar ?? 0.05, 208 | growingBox: false, 209 | margins: EdgeInsets.all(margins ?? 25), 210 | ), 211 | ); 212 | 213 | @override 214 | void render(Canvas c) { 215 | final rect = Rect.fromLTWH(0, 0, width, height); 216 | c.drawRect(rect, Paint()..color = Colors.black); 217 | super.render(c); 218 | } 219 | } 220 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.8.2" 11 | audioplayers: 12 | dependency: transitive 13 | description: 14 | name: audioplayers 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.0.1" 18 | audioplayers_android: 19 | dependency: transitive 20 | description: 21 | name: audioplayers_android 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.0.1" 25 | audioplayers_darwin: 26 | dependency: transitive 27 | description: 28 | name: audioplayers_darwin 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.0.1" 32 | audioplayers_linux: 33 | dependency: transitive 34 | description: 35 | name: audioplayers_linux 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.0.0" 39 | audioplayers_platform_interface: 40 | dependency: transitive 41 | description: 42 | name: audioplayers_platform_interface 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.0.0" 46 | audioplayers_web: 47 | dependency: transitive 48 | description: 49 | name: audioplayers_web 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.0.0" 53 | audioplayers_windows: 54 | dependency: transitive 55 | description: 56 | name: audioplayers_windows 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.0.0" 60 | boolean_selector: 61 | dependency: transitive 62 | description: 63 | name: boolean_selector 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.1.0" 67 | characters: 68 | dependency: transitive 69 | description: 70 | name: characters 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "1.2.0" 74 | charcode: 75 | dependency: transitive 76 | description: 77 | name: charcode 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "1.3.1" 81 | clock: 82 | dependency: transitive 83 | description: 84 | name: clock 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "1.1.0" 88 | collection: 89 | dependency: transitive 90 | description: 91 | name: collection 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "1.16.0" 95 | crypto: 96 | dependency: transitive 97 | description: 98 | name: crypto 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "3.0.2" 102 | fake_async: 103 | dependency: transitive 104 | description: 105 | name: fake_async 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "1.3.0" 109 | ffi: 110 | dependency: transitive 111 | description: 112 | name: ffi 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "2.0.1" 116 | file: 117 | dependency: transitive 118 | description: 119 | name: file 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "6.1.4" 123 | flame: 124 | dependency: "direct main" 125 | description: 126 | name: flame 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "1.3.0" 130 | flame_audio: 131 | dependency: "direct main" 132 | description: 133 | name: flame_audio 134 | url: "https://pub.dartlang.org" 135 | source: hosted 136 | version: "1.3.1" 137 | flutter: 138 | dependency: "direct main" 139 | description: flutter 140 | source: sdk 141 | version: "0.0.0" 142 | flutter_lints: 143 | dependency: "direct dev" 144 | description: 145 | name: flutter_lints 146 | url: "https://pub.dartlang.org" 147 | source: hosted 148 | version: "2.0.1" 149 | flutter_test: 150 | dependency: "direct dev" 151 | description: flutter 152 | source: sdk 153 | version: "0.0.0" 154 | flutter_web_plugins: 155 | dependency: transitive 156 | description: flutter 157 | source: sdk 158 | version: "0.0.0" 159 | http: 160 | dependency: transitive 161 | description: 162 | name: http 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "0.13.5" 166 | http_parser: 167 | dependency: transitive 168 | description: 169 | name: http_parser 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "4.0.1" 173 | js: 174 | dependency: transitive 175 | description: 176 | name: js 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "0.6.4" 180 | lints: 181 | dependency: transitive 182 | description: 183 | name: lints 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "2.0.0" 187 | matcher: 188 | dependency: transitive 189 | description: 190 | name: matcher 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "0.12.11" 194 | material_color_utilities: 195 | dependency: transitive 196 | description: 197 | name: material_color_utilities 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "0.1.4" 201 | meta: 202 | dependency: transitive 203 | description: 204 | name: meta 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "1.7.0" 208 | ordered_set: 209 | dependency: transitive 210 | description: 211 | name: ordered_set 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "5.0.0" 215 | path: 216 | dependency: transitive 217 | description: 218 | name: path 219 | url: "https://pub.dartlang.org" 220 | source: hosted 221 | version: "1.8.1" 222 | path_provider: 223 | dependency: transitive 224 | description: 225 | name: path_provider 226 | url: "https://pub.dartlang.org" 227 | source: hosted 228 | version: "2.0.11" 229 | path_provider_android: 230 | dependency: transitive 231 | description: 232 | name: path_provider_android 233 | url: "https://pub.dartlang.org" 234 | source: hosted 235 | version: "2.0.19" 236 | path_provider_ios: 237 | dependency: transitive 238 | description: 239 | name: path_provider_ios 240 | url: "https://pub.dartlang.org" 241 | source: hosted 242 | version: "2.0.11" 243 | path_provider_linux: 244 | dependency: transitive 245 | description: 246 | name: path_provider_linux 247 | url: "https://pub.dartlang.org" 248 | source: hosted 249 | version: "2.1.7" 250 | path_provider_macos: 251 | dependency: transitive 252 | description: 253 | name: path_provider_macos 254 | url: "https://pub.dartlang.org" 255 | source: hosted 256 | version: "2.0.6" 257 | path_provider_platform_interface: 258 | dependency: transitive 259 | description: 260 | name: path_provider_platform_interface 261 | url: "https://pub.dartlang.org" 262 | source: hosted 263 | version: "2.0.4" 264 | path_provider_windows: 265 | dependency: transitive 266 | description: 267 | name: path_provider_windows 268 | url: "https://pub.dartlang.org" 269 | source: hosted 270 | version: "2.1.2" 271 | platform: 272 | dependency: transitive 273 | description: 274 | name: platform 275 | url: "https://pub.dartlang.org" 276 | source: hosted 277 | version: "3.1.0" 278 | plugin_platform_interface: 279 | dependency: transitive 280 | description: 281 | name: plugin_platform_interface 282 | url: "https://pub.dartlang.org" 283 | source: hosted 284 | version: "2.1.2" 285 | process: 286 | dependency: transitive 287 | description: 288 | name: process 289 | url: "https://pub.dartlang.org" 290 | source: hosted 291 | version: "4.2.4" 292 | sky_engine: 293 | dependency: transitive 294 | description: flutter 295 | source: sdk 296 | version: "0.0.99" 297 | source_span: 298 | dependency: transitive 299 | description: 300 | name: source_span 301 | url: "https://pub.dartlang.org" 302 | source: hosted 303 | version: "1.8.2" 304 | stack_trace: 305 | dependency: transitive 306 | description: 307 | name: stack_trace 308 | url: "https://pub.dartlang.org" 309 | source: hosted 310 | version: "1.10.0" 311 | stream_channel: 312 | dependency: transitive 313 | description: 314 | name: stream_channel 315 | url: "https://pub.dartlang.org" 316 | source: hosted 317 | version: "2.1.0" 318 | string_scanner: 319 | dependency: transitive 320 | description: 321 | name: string_scanner 322 | url: "https://pub.dartlang.org" 323 | source: hosted 324 | version: "1.1.0" 325 | synchronized: 326 | dependency: transitive 327 | description: 328 | name: synchronized 329 | url: "https://pub.dartlang.org" 330 | source: hosted 331 | version: "3.0.0+2" 332 | term_glyph: 333 | dependency: transitive 334 | description: 335 | name: term_glyph 336 | url: "https://pub.dartlang.org" 337 | source: hosted 338 | version: "1.2.0" 339 | test_api: 340 | dependency: transitive 341 | description: 342 | name: test_api 343 | url: "https://pub.dartlang.org" 344 | source: hosted 345 | version: "0.4.9" 346 | typed_data: 347 | dependency: transitive 348 | description: 349 | name: typed_data 350 | url: "https://pub.dartlang.org" 351 | source: hosted 352 | version: "1.3.1" 353 | uuid: 354 | dependency: transitive 355 | description: 356 | name: uuid 357 | url: "https://pub.dartlang.org" 358 | source: hosted 359 | version: "3.0.6" 360 | vector_math: 361 | dependency: transitive 362 | description: 363 | name: vector_math 364 | url: "https://pub.dartlang.org" 365 | source: hosted 366 | version: "2.1.2" 367 | win32: 368 | dependency: transitive 369 | description: 370 | name: win32 371 | url: "https://pub.dartlang.org" 372 | source: hosted 373 | version: "2.7.0" 374 | xdg_directories: 375 | dependency: transitive 376 | description: 377 | name: xdg_directories 378 | url: "https://pub.dartlang.org" 379 | source: hosted 380 | version: "0.2.0+1" 381 | sdks: 382 | dart: ">=2.17.6 <3.0.0" 383 | flutter: ">=3.0.0" 384 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: brain_punk 2 | description: The Brain Game. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | version: 1.0.0+1 9 | 10 | environment: 11 | sdk: ">=2.17.6 <3.0.0" 12 | 13 | dependencies: 14 | flutter: 15 | sdk: flutter 16 | 17 | flame: 1.3.0 18 | flame_audio: ^1.3.1 19 | 20 | dev_dependencies: 21 | flutter_test: 22 | sdk: flutter 23 | flutter_lints: ^2.0.0 24 | 25 | # For information on the generic Dart part of this file, see the 26 | # following page: https://dart.dev/tools/pub/pubspec 27 | 28 | # The following section is specific to Flutter packages. 29 | flutter: 30 | uses-material-design: true 31 | 32 | assets: 33 | - assets/images/story/ 34 | - assets/images/buttons/ 35 | - assets/data/ 36 | 37 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/images/brainpunk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animator/brain_punk/cb99de7e85881eeee1083d039f0305243c7c56de/web/images/brainpunk.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | BrainPunk 33 | 38 | 39 | 40 | 50 | 51 | 52 | 53 | 54 |
55 | 83 | Loading indicator... 84 |
85 | 86 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "brain_punk", 3 | "short_name": "brain_punk", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | --------------------------------------------------------------------------------